WIP - failing for postgres on Customer::find().count(db).await.unwrap();
This commit is contained in:
parent
54461172de
commit
402c003d84
@ -31,6 +31,6 @@ async fn create_entities(db: &DatabaseConnection) {
|
||||
crud::updates::test_update_bakery(db).await;
|
||||
crud::updates::test_update_deleted_customer(db).await;
|
||||
|
||||
// crud::deletes::test_delete_cake(db).await;
|
||||
// crud::deletes::test_delete_bakery(db).await;
|
||||
crud::deletes::test_delete_cake(db).await;
|
||||
crud::deletes::test_delete_bakery(db).await;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ pub async fn test_create_order(db: &DbConn) {
|
||||
let customer_model = customer.unwrap();
|
||||
assert_eq!(customer_model.name, "Kate");
|
||||
|
||||
let bakery: Option<bakery::Model> = Bakery::find_by_id(order_model.bakery_id as u64)
|
||||
let bakery: Option<bakery::Model> = Bakery::find_by_id(order_model.bakery_id as i64)
|
||||
.one(db)
|
||||
.await
|
||||
.expect("could not find bakery");
|
||||
|
@ -130,10 +130,11 @@ pub async fn test_update_deleted_customer(db: &DbConn) {
|
||||
|
||||
assert_eq!(Customer::find().count(db).await.unwrap(), init_n_customers);
|
||||
|
||||
let customer: Option<customer::Model> = Customer::find_by_id(customer_id.clone().unwrap())
|
||||
.one(db)
|
||||
.await
|
||||
.expect("could not find customer");
|
||||
let customer: Option<customer::Model> =
|
||||
Customer::find_by_id(customer_id.clone().unwrap() as i64)
|
||||
.one(db)
|
||||
.await
|
||||
.expect("could not find customer");
|
||||
|
||||
assert_eq!(customer, None);
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ use sea_query::{ColumnDef, TableCreateStatement};
|
||||
#[cfg_attr(feature = "runtime-async-std", async_std::test)]
|
||||
#[cfg_attr(feature = "runtime-actix", actix_rt::test)]
|
||||
#[cfg_attr(feature = "runtime-tokio", tokio::test)]
|
||||
#[async_std::test]
|
||||
#[cfg(feature = "sqlx-postgres")]
|
||||
async fn main() {
|
||||
let base_url = "postgres://root:root@localhost";
|
||||
|
Loading…
x
Reference in New Issue
Block a user