Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 5, 2023
1 parent 130c6d2 commit 85c841f
Show file tree
Hide file tree
Showing 34 changed files with 367 additions and 367 deletions.
16 changes: 8 additions & 8 deletions examples/actix3_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/actix_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/axum_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/graphql_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![note::Model {
.append_query_results([
[note::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![note::Model {
[note::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![note::Model {
[note::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![note::Model {
[note::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![note::Model {
[note::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![note::Model {
[note::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/jsonrpsee_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/poem_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/rocket_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
16 changes: 8 additions & 8 deletions examples/rocket_okapi_example/core/tests/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ use sea_orm::*;
#[cfg(feature = "mock")]
pub fn prepare_mock_db() -> DatabaseConnection {
MockDatabase::new(DatabaseBackend::Postgres)
.append_query_results(vec![
vec![post::Model {
.append_query_results([
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 6,
title: "Title D".to_owned(),
text: "Text D".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "Title A".to_owned(),
text: "Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 1,
title: "New Title A".to_owned(),
text: "New Text A".to_owned(),
}],
vec![post::Model {
[post::Model {
id: 5,
title: "Title C".to_owned(),
text: "Text C".to_owned(),
}],
])
.append_exec_results(vec![
.append_exec_results([
MockExecResult {
last_insert_id: 6,
rows_affected: 1,
Expand Down
Loading

0 comments on commit 85c841f

Please sign in to comment.