diff --git a/tests/crud/create_lineitem.rs b/tests/crud/create_lineitem.rs index 22810913..1030651a 100644 --- a/tests/crud/create_lineitem.rs +++ b/tests/crud/create_lineitem.rs @@ -105,7 +105,7 @@ pub async fn test_create_lineitem(db: &DbConn) { assert_eq!(lineitem_model.price, dec!(7.55)); - let cake: Option = Cake::find_by_id(lineitem_model.cake_id as u64) + let cake: Option = Cake::find_by_id(lineitem_model.cake_id) .one(db) .await .expect("could not find cake"); diff --git a/tests/crud/create_order.rs b/tests/crud/create_order.rs index e613802b..e3b12b52 100644 --- a/tests/crud/create_order.rs +++ b/tests/crud/create_order.rs @@ -103,7 +103,7 @@ pub async fn test_create_order(db: &DbConn) { let order_model = order.unwrap(); assert_eq!(order_model.total, dec!(15.10)); - let customer: Option = Customer::find_by_id(order_model.customer_id as u64) + let customer: Option = Customer::find_by_id(order_model.customer_id) .one(db) .await .expect("could not find customer"); @@ -111,7 +111,7 @@ pub async fn test_create_order(db: &DbConn) { let customer_model = customer.unwrap(); assert_eq!(customer_model.name, "Kate"); - let bakery: Option = Bakery::find_by_id(order_model.bakery_id as i64) + let bakery: Option = Bakery::find_by_id(order_model.bakery_id) .one(db) .await .expect("could not find bakery"); diff --git a/tests/crud/updates.rs b/tests/crud/updates.rs index 94c11aaf..df797ed3 100644 --- a/tests/crud/updates.rs +++ b/tests/crud/updates.rs @@ -131,7 +131,7 @@ pub async fn test_update_deleted_customer(db: &DbConn) { assert_eq!(Customer::find().count(db).await.unwrap(), init_n_customers); let customer: Option = - Customer::find_by_id(customer_id.clone().unwrap() as i64) + Customer::find_by_id(customer_id.clone().unwrap()) .one(db) .await .expect("could not find customer"); diff --git a/tests/sequential_op_tests.rs b/tests/sequential_op_tests.rs index 6e1377bc..300812cf 100644 --- a/tests/sequential_op_tests.rs +++ b/tests/sequential_op_tests.rs @@ -183,7 +183,7 @@ async fn find_baker_least_sales(db: &DatabaseConnection) -> Option results.sort_by(|a, b| b.cakes_sold.cmp(&a.cakes_sold)); - Baker::find_by_id(results.last().unwrap().id as i64) + Baker::find_by_id(results.last().unwrap().id) .one(db) .await .unwrap()