From 68787d14125f365a22d6208941ab4d96e10ba847 Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Sat, 18 Sep 2021 15:47:59 +0800 Subject: [PATCH] Refactor uuid test --- tests/common/bakery_chain/metadata.rs | 8 +------- tests/{primary_key_tests.rs => uuid_tests.rs} | 5 +---- 2 files changed, 2 insertions(+), 11 deletions(-) rename tests/{primary_key_tests.rs => uuid_tests.rs} (91%) diff --git a/tests/common/bakery_chain/metadata.rs b/tests/common/bakery_chain/metadata.rs index 2585b2db..95a7a48b 100644 --- a/tests/common/bakery_chain/metadata.rs +++ b/tests/common/bakery_chain/metadata.rs @@ -10,13 +10,7 @@ pub struct Model { pub bytes: Vec, } -#[derive(Copy, Clone, Debug, EnumIter)] +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation {} -impl RelationTrait for Relation { - fn def(&self) -> RelationDef { - unreachable!() - } -} - impl ActiveModelBehavior for ActiveModel {} diff --git a/tests/primary_key_tests.rs b/tests/uuid_tests.rs similarity index 91% rename from tests/primary_key_tests.rs rename to tests/uuid_tests.rs index 06b2a13a..e58daca4 100644 --- a/tests/primary_key_tests.rs +++ b/tests/uuid_tests.rs @@ -2,7 +2,6 @@ pub mod common; pub use common::{bakery_chain::*, setup::*, TestContext}; use sea_orm::{entity::prelude::*, DatabaseConnection, IntoActiveModel}; -use uuid::Uuid; #[sea_orm_macros::test] #[cfg(any( @@ -11,10 +10,8 @@ use uuid::Uuid; feature = "sqlx-postgres" ))] async fn main() -> Result<(), DbErr> { - let ctx = TestContext::new("bakery_chain_schema_primary_key_tests").await; - + let ctx = TestContext::new("bakery_chain_schema_uuid_tests").await; create_metadata(&ctx.db).await?; - ctx.delete().await; Ok(())