()
| 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() { |
nothing calls this directly
no test coverage detected