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

Function test_load_one_empty

src/query/loader.rs:541–556  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

539
540 #[tokio::test]
541 async fn test_load_one_empty() {
542 use sea_orm::{entity::prelude::*, tests_cfg::*, DbBackend, LoaderTrait, MockDatabase};
543
544 let db = MockDatabase::new(DbBackend::Postgres)
545 .append_query_results([[cake_model(1), cake_model(2)]])
546 .into_connection();
547
548 let fruits: Vec<fruit::Model> = vec![];
549
550 let cakes = fruits
551 .load_one(cake::Entity::find(), &db)
552 .await
553 .expect("Should return something");
554
555 assert_eq!(cakes, []);
556 }
557
558 #[tokio::test]
559 async fn test_load_many() {

Callers

nothing calls this directly

Calls 5

into_connectionMethod · 0.80
append_query_resultsMethod · 0.80
load_oneMethod · 0.80
cake_modelFunction · 0.70
newFunction · 0.50

Tested by

no test coverage detected