MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / partial_model_nested

Function partial_model_nested

tests/partial_model_tests.rs:220–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218
219#[sea_orm_macros::test]
220async fn partial_model_nested() {
221 // SELECT "bakery"."id" AS "basics_id", "bakery"."name" AS "basics_title", "bakery"."profit_margin" AS "profit" FROM "bakery" LIMIT 1
222 let ctx = TestContext::new("partial_model_nested").await;
223 create_tables(&ctx.db).await.unwrap();
224
225 seed_data::init_1(&ctx, true).await;
226
227 let bakery: BakeryDetails = bakery::Entity::find()
228 .into_partial_model()
229 .one(&ctx.db)
230 .await
231 .expect("succeeds to get the result")
232 .expect("exactly one model in DB");
233
234 assert_eq!(bakery.basics.id, 42);
235 assert_eq!(bakery.basics.title, "cool little bakery");
236 assert_eq!(bakery.profit, 4.1);
237
238 ctx.delete().await;
239}
240
241#[sea_orm_macros::test]
242async fn partial_model_join_three() {

Callers

nothing calls this directly

Calls 7

init_1Function · 0.85
unwrapMethod · 0.80
newFunction · 0.50
create_tablesFunction · 0.50
oneMethod · 0.45
into_partial_modelMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected