From f686bc7692e04265adbb17827276f1be31ad5858 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Fri, 4 Jul 2025 19:50:29 +0000 Subject: [PATCH] feat(tests): move integration and unit tests to correct locations --- Cargo.toml | 4 +- tests/integration_auth_tests.rs | 4 +- tests/integration_config_oidc_tests.rs | 2 +- tests/integration_db_tests.rs | 6 +- tests/integration_document_routes_tests.rs | 6 +- tests/integration_documents_database_tests.rs | 64 +++++++++---------- tests/integration_enhanced_ocr_tests.rs | 4 +- tests/integration_enhanced_search_tests.rs | 6 +- tests/integration_failed_documents_tests.rs | 2 +- tests/integration_file_service_tests.rs | 4 +- tests/integration_ignored_files_tests.rs | 8 +-- tests/integration_labels_tests.rs | 6 +- tests/integration_ocr_retry_db_tests.rs | 4 +- .../integration_ocr_retry_regression_tests.rs | 2 +- tests/integration_oidc_tests.rs | 20 +++--- tests/integration_settings_tests.rs | 4 +- tests/integration_sql_type_safety_tests.rs | 2 +- tests/integration_users_tests.rs | 6 +- tests/migration_constraint_tests.rs | 2 +- tests/migration_integration_tests.rs | 2 +- 20 files changed, 80 insertions(+), 78 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9763377..3e6859b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,12 +56,14 @@ aws-credential-types = { version = "1.2", optional = true } aws-types = { version = "1.3", optional = true } sha2 = "0.10" utoipa-swagger-ui = { version = "9", features = ["axum"] } +testcontainers = { version = "0.24", optional = true } +testcontainers-modules = { version = "0.12", features = ["postgres"], optional = true } [features] default = ["ocr", "s3"] ocr = ["tesseract", "pdf-extract", "image", "imageproc", "raw-cpuid"] s3 = ["aws-config", "aws-sdk-s3", "aws-credential-types", "aws-types"] -test-utils = [] +test-utils = ["testcontainers", "testcontainers-modules"] [dev-dependencies] tempfile = "3" diff --git a/tests/integration_auth_tests.rs b/tests/integration_auth_tests.rs index c9c98c7..55443d4 100644 --- a/tests/integration_auth_tests.rs +++ b/tests/integration_auth_tests.rs @@ -10,13 +10,13 @@ mod tests { username: "testuser".to_string(), email: "test@example.com".to_string(), password_hash: Some("hashed_password".to_string()), - role: crate::models::UserRole::User, + role: readur::models::UserRole::User, created_at: Utc::now(), updated_at: Utc::now(), oidc_subject: None, oidc_issuer: None, oidc_email: None, - auth_provider: crate::models::AuthProvider::Local, + auth_provider: readur::models::AuthProvider::Local, } } diff --git a/tests/integration_config_oidc_tests.rs b/tests/integration_config_oidc_tests.rs index cbf09c5..bb3e29d 100644 --- a/tests/integration_config_oidc_tests.rs +++ b/tests/integration_config_oidc_tests.rs @@ -1,6 +1,6 @@ #[cfg(test)] mod tests { - use crate::config::Config; + use readur::config::Config; use std::env; use std::sync::Mutex; diff --git a/tests/integration_db_tests.rs b/tests/integration_db_tests.rs index e2d36af..6b7f97b 100644 --- a/tests/integration_db_tests.rs +++ b/tests/integration_db_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::test_utils::TestContext; - use crate::models::{CreateUser, Document, SearchRequest}; + use readur::test_utils::TestContext; + use readur::models::{CreateUser, Document, SearchRequest}; use chrono::Utc; use uuid::Uuid; @@ -10,7 +10,7 @@ mod tests { username: format!("testuser_{}", suffix), email: format!("test_{}@example.com", suffix), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), } } diff --git a/tests/integration_document_routes_tests.rs b/tests/integration_document_routes_tests.rs index 3e7af69..862d364 100644 --- a/tests/integration_document_routes_tests.rs +++ b/tests/integration_document_routes_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod document_routes_deletion_tests { - use crate::models::{UserRole, User, Document, AuthProvider}; - use crate::routes::documents::{BulkDeleteRequest}; + use readur::models::{UserRole, User, Document, AuthProvider}; + use readur::routes::documents::{BulkDeleteRequest}; use axum::http::StatusCode; use chrono::Utc; use serde_json::json; @@ -376,7 +376,7 @@ mod document_routes_deletion_tests { // Low confidence deletion tests mod low_confidence_deletion_tests { use super::*; - use crate::routes::documents::DeleteLowConfidenceRequest; + use readur::routes::documents::DeleteLowConfidenceRequest; fn create_low_confidence_document(user_id: Uuid, confidence: f32) -> Document { Document { diff --git a/tests/integration_documents_database_tests.rs b/tests/integration_documents_database_tests.rs index c7d7d6a..b9ad341 100644 --- a/tests/integration_documents_database_tests.rs +++ b/tests/integration_documents_database_tests.rs @@ -330,8 +330,8 @@ mod tests { #[cfg(test)] mod document_deletion_tests { use super::*; - use crate::test_utils::TestContext; - use crate::models::{UserRole, User, Document, AuthProvider, CreateUser}; + use readur::test_utils::TestContext; + use readur::models::{UserRole, User, Document, AuthProvider, CreateUser}; use chrono::Utc; use uuid::Uuid; @@ -685,8 +685,8 @@ mod document_deletion_tests { #[cfg(test)] mod rbac_deletion_tests { use super::*; - use crate::test_utils::TestContext; - use crate::models::{UserRole, CreateUser}; + use readur::test_utils::TestContext; + use readur::models::{UserRole, CreateUser}; use uuid::Uuid; #[tokio::test] @@ -1201,11 +1201,11 @@ mod deletion_error_handling_tests { let db = &ctx.state.db; // Create user using direct database approach - let user_data = crate::models::CreateUser { + let user_data = readur::models::CreateUser { username: format!("testuser_{}", Uuid::new_v4()), email: format!("test_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user = db.create_user(user_data).await.expect("Failed to create user"); @@ -1228,11 +1228,11 @@ mod deletion_error_handling_tests { let db = &ctx.state.db; // Create user using direct database approach - let user_data = crate::models::CreateUser { + let user_data = readur::models::CreateUser { username: format!("testuser_{}", Uuid::new_v4()), email: format!("test_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user = db.create_user(user_data).await.expect("Failed to create user"); @@ -1255,11 +1255,11 @@ mod deletion_error_handling_tests { let db = &ctx.state.db; // Create user using direct database approach - let user_data = crate::models::CreateUser { + let user_data = readur::models::CreateUser { username: format!("testuser_{}", Uuid::new_v4()), email: format!("test_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user = db.create_user(user_data).await.expect("Failed to create user"); @@ -1381,19 +1381,19 @@ mod deletion_error_handling_tests { let ctx = TestContext::new().await; // Create users using direct database approach - let user1_data = crate::models::CreateUser { + let user1_data = readur::models::CreateUser { username: format!("testuser1_{}", Uuid::new_v4()), email: format!("test1_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user1 = ctx.state.db.create_user(user1_data).await.expect("Failed to create user1"); - let user2_data = crate::models::CreateUser { + let user2_data = readur::models::CreateUser { username: format!("testuser2_{}", Uuid::new_v4()), email: format!("test2_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user2 = ctx.state.db.create_user(user2_data).await.expect("Failed to create user2"); @@ -1572,7 +1572,7 @@ mod deletion_error_handling_tests { mod low_confidence_deletion_db_tests { use super::*; - use crate::models::UserRole; + use readur::models::UserRole; #[cfg(test)] fn create_test_document_with_confidence(user_id: Uuid, confidence: f32) -> Document { @@ -1900,7 +1900,7 @@ mod deletion_error_handling_tests { // Test as regular user let failed_docs = database - .find_failed_ocr_documents(user_id, crate::models::UserRole::User, 100, 0) + .find_failed_ocr_documents(user_id, readur::models::UserRole::User, 100, 0) .await .unwrap(); @@ -1916,7 +1916,7 @@ mod deletion_error_handling_tests { // Test as admin let admin_failed_docs = database - .find_failed_ocr_documents(admin_user_id, crate::models::UserRole::Admin, 100, 0) + .find_failed_ocr_documents(admin_user_id, readur::models::UserRole::Admin, 100, 0) .await .unwrap(); @@ -1974,7 +1974,7 @@ mod deletion_error_handling_tests { // Test with threshold of 50% - should include low confidence and failed only let threshold_50_docs = database - .find_low_confidence_and_failed_documents(user_id, crate::models::UserRole::User, 50.0, 100, 0) + .find_low_confidence_and_failed_documents(user_id, readur::models::UserRole::User, 50.0, 100, 0) .await .unwrap(); @@ -1989,7 +1989,7 @@ mod deletion_error_handling_tests { // Test with threshold of 70% - should include low and medium confidence and failed only let threshold_70_docs = database - .find_low_confidence_and_failed_documents(user_id, crate::models::UserRole::User, 70.0, 100, 0) + .find_low_confidence_and_failed_documents(user_id, readur::models::UserRole::User, 70.0, 100, 0) .await .unwrap(); @@ -2004,7 +2004,7 @@ mod deletion_error_handling_tests { // Test with threshold of 100% - should include all confidence levels and failed only let threshold_100_docs = database - .find_low_confidence_and_failed_documents(user_id, crate::models::UserRole::User, 100.0, 100, 0) + .find_low_confidence_and_failed_documents(user_id, readur::models::UserRole::User, 100.0, 100, 0) .await .unwrap(); @@ -2019,7 +2019,7 @@ mod deletion_error_handling_tests { // Test with threshold of 0% - should only include failed documents let threshold_0_docs = database - .find_low_confidence_and_failed_documents(user_id, crate::models::UserRole::User, 0.0, 100, 0) + .find_low_confidence_and_failed_documents(user_id, readur::models::UserRole::User, 0.0, 100, 0) .await .unwrap(); @@ -2068,7 +2068,7 @@ mod deletion_error_handling_tests { // Test original method - should only find documents with explicit confidence below threshold let original_results = database - .find_documents_by_confidence_threshold(user_id, crate::models::UserRole::User, 50.0, 100, 0) + .find_documents_by_confidence_threshold(user_id, readur::models::UserRole::User, 50.0, 100, 0) .await .unwrap(); @@ -2088,11 +2088,11 @@ mod deletion_error_handling_tests { let database = &ctx.state.db; // Create user using direct database approach - let user_data = crate::models::CreateUser { + let user_data = readur::models::CreateUser { username: format!("testuser_{}", Uuid::new_v4()), email: format!("test_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user = database.create_user(user_data).await.expect("Failed to create user"); let user_id = user.id; @@ -2122,7 +2122,7 @@ mod deletion_error_handling_tests { // Test ordering in combined query let results = database - .find_low_confidence_and_failed_documents(user_id, crate::models::UserRole::User, 50.0, 100, 0) + .find_low_confidence_and_failed_documents(user_id, readur::models::UserRole::User, 50.0, 100, 0) .await .unwrap(); @@ -2153,20 +2153,20 @@ mod deletion_error_handling_tests { let database = &ctx.state.db; // Create users using direct database approach - let user1_data = crate::models::CreateUser { + let user1_data = readur::models::CreateUser { username: format!("testuser1_{}", Uuid::new_v4()), email: format!("test1_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user1 = database.create_user(user1_data).await.expect("Failed to create user1"); let user1_id = user1.id; - let user2_data = crate::models::CreateUser { + let user2_data = readur::models::CreateUser { username: format!("testuser2_{}", Uuid::new_v4()), email: format!("test2_{}@example.com", Uuid::new_v4()), password: "password123".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let user2 = database.create_user(user2_data).await.expect("Failed to create user2"); let user2_id = user2.id; @@ -2195,7 +2195,7 @@ mod deletion_error_handling_tests { // Test user1 can only see their documents let user1_results = database - .find_low_confidence_and_failed_documents(user1_id, crate::models::UserRole::User, 50.0, 100, 0) + .find_low_confidence_and_failed_documents(user1_id, readur::models::UserRole::User, 50.0, 100, 0) .await .unwrap(); @@ -2208,7 +2208,7 @@ mod deletion_error_handling_tests { // Test user2 can only see their documents let user2_results = database - .find_low_confidence_and_failed_documents(user2_id, crate::models::UserRole::User, 50.0, 100, 0) + .find_low_confidence_and_failed_documents(user2_id, readur::models::UserRole::User, 50.0, 100, 0) .await .unwrap(); @@ -2221,7 +2221,7 @@ mod deletion_error_handling_tests { // Test admin can see all documents let admin_results = database - .find_low_confidence_and_failed_documents(user1_id, crate::models::UserRole::Admin, 50.0, 100, 0) + .find_low_confidence_and_failed_documents(user1_id, readur::models::UserRole::Admin, 50.0, 100, 0) .await .unwrap(); diff --git a/tests/integration_enhanced_ocr_tests.rs b/tests/integration_enhanced_ocr_tests.rs index 28e7ded..1d1d05e 100644 --- a/tests/integration_enhanced_ocr_tests.rs +++ b/tests/integration_enhanced_ocr_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::ocr::enhanced::{EnhancedOcrService, OcrResult, ImageQualityStats}; - use crate::models::Settings; + use readur::ocr::enhanced::{EnhancedOcrService, OcrResult, ImageQualityStats}; + use readur::models::Settings; use std::fs; use tempfile::{NamedTempFile, TempDir}; diff --git a/tests/integration_enhanced_search_tests.rs b/tests/integration_enhanced_search_tests.rs index 4d40b59..4095f3a 100644 --- a/tests/integration_enhanced_search_tests.rs +++ b/tests/integration_enhanced_search_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::db::Database; - use crate::models::{ + use readur::db::Database; + use readur::models::{ CreateUser, Document, SearchRequest, SearchMode, EnhancedDocumentResponse, SearchSnippet, HighlightRange }; @@ -901,7 +901,7 @@ mod tests { #[tokio::test] #[ignore = "Requires PostgreSQL database for integration testing"] async fn test_enhanced_search_integration() { - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::test_utils::{TestContext, TestAuthHelper}; let ctx = TestContext::new().await; let auth_helper = TestAuthHelper::new(ctx.app.clone()); diff --git a/tests/integration_failed_documents_tests.rs b/tests/integration_failed_documents_tests.rs index d15d6b7..9a92892 100644 --- a/tests/integration_failed_documents_tests.rs +++ b/tests/integration_failed_documents_tests.rs @@ -1,4 +1,4 @@ -use crate::db::constraint_validation::ConstraintValidator; +use readur::db::constraint_validation::ConstraintValidator; /// Simple unit tests for failed_documents functionality /// These tests focus on business logic and constraint validation diff --git a/tests/integration_file_service_tests.rs b/tests/integration_file_service_tests.rs index ba3a6b6..8e4a00b 100644 --- a/tests/integration_file_service_tests.rs +++ b/tests/integration_file_service_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] -use crate::services::file_service::FileService; +use readur::services::file_service::FileService; #[cfg(test)] -use crate::models::Document; +use readur::models::Document; #[cfg(test)] use std::fs; #[cfg(test)] diff --git a/tests/integration_ignored_files_tests.rs b/tests/integration_ignored_files_tests.rs index 4ad6926..10c3b42 100644 --- a/tests/integration_ignored_files_tests.rs +++ b/tests/integration_ignored_files_tests.rs @@ -1,12 +1,12 @@ #[cfg(test)] mod tests { - use crate::db::ignored_files::{ + use readur::db::ignored_files::{ create_ignored_file, list_ignored_files, get_ignored_file_by_id, delete_ignored_file, is_file_ignored, count_ignored_files, bulk_delete_ignored_files, create_ignored_file_from_document }; - use crate::models::{CreateIgnoredFile, IgnoredFilesQuery, User, UserRole, Document, AuthProvider}; - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::models::{CreateIgnoredFile, IgnoredFilesQuery, User, UserRole, Document, AuthProvider}; + use readur::test_utils::{TestContext, TestAuthHelper}; use uuid::Uuid; use chrono::Utc; @@ -197,7 +197,7 @@ mod tests { let ctx = TestContext::new().await; let auth_helper = TestAuthHelper::new(ctx.app.clone()); let user = auth_helper.create_test_user().await; - let document = ctx.state.db.create_document(crate::models::Document { + let document = ctx.state.db.create_document(readur::models::Document { id: Uuid::new_v4(), filename: "test_document.pdf".to_string(), original_filename: "test_document.pdf".to_string(), diff --git a/tests/integration_labels_tests.rs b/tests/integration_labels_tests.rs index 497b4cb..34576e5 100644 --- a/tests/integration_labels_tests.rs +++ b/tests/integration_labels_tests.rs @@ -1,9 +1,9 @@ #[cfg(test)] mod tests { use super::*; - use crate::models::UserRole; - use crate::routes::labels::{CreateLabel, UpdateLabel, LabelAssignment, Label}; - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::models::UserRole; + use readur::routes::labels::{CreateLabel, UpdateLabel, LabelAssignment, Label}; + use readur::test_utils::{TestContext, TestAuthHelper}; use axum::http::StatusCode; use chrono::Utc; use serde_json::json; diff --git a/tests/integration_ocr_retry_db_tests.rs b/tests/integration_ocr_retry_db_tests.rs index 0c9af51..693e1f0 100644 --- a/tests/integration_ocr_retry_db_tests.rs +++ b/tests/integration_ocr_retry_db_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::db::ocr_retry::*; - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::db::ocr_retry::*; + use readur::test_utils::{TestContext, TestAuthHelper}; use sqlx::Row; use uuid::Uuid; diff --git a/tests/integration_ocr_retry_regression_tests.rs b/tests/integration_ocr_retry_regression_tests.rs index 986239b..2eae7d2 100644 --- a/tests/integration_ocr_retry_regression_tests.rs +++ b/tests/integration_ocr_retry_regression_tests.rs @@ -4,7 +4,7 @@ mod ocr_retry_regression_tests { use testcontainers::{runners::AsyncRunner, ContainerAsync}; use testcontainers_modules::postgres::Postgres; use uuid::Uuid; - use crate::routes::documents_ocr_retry::DocumentInfo; + use readur::routes::documents_ocr_retry::DocumentInfo; async fn setup_test_db() -> (ContainerAsync, PgPool) { let postgres_image = Postgres::default(); diff --git a/tests/integration_oidc_tests.rs b/tests/integration_oidc_tests.rs index d5209f0..fa5ccfa 100644 --- a/tests/integration_oidc_tests.rs +++ b/tests/integration_oidc_tests.rs @@ -14,7 +14,7 @@ mod tests { .or_else(|_| std::env::var("DATABASE_URL")) .unwrap_or_else(|_| "postgresql://readur:readur@localhost:5432/readur".to_string()); - let config = crate::config::Config { + let config = readur::config::Config { database_url: database_url.clone(), server_address: "127.0.0.1:0".to_string(), jwt_secret: "test-secret".to_string(), @@ -37,7 +37,7 @@ mod tests { oidc_redirect_uri: None, }; - let db = crate::db::Database::new(&config.database_url).await.unwrap(); + let db = readur::db::Database::new(&config.database_url).await.unwrap(); // Retry migration up to 3 times to handle concurrent test execution for attempt in 1..=3 { @@ -53,13 +53,13 @@ mod tests { } let app = axum::Router::new() - .nest("/api/auth", crate::routes::auth::router()) + .nest("/api/auth", readur::routes::auth::router()) .with_state(Arc::new(AppState { db: db.clone(), config, webdav_scheduler: None, source_scheduler: None, - queue_service: Arc::new(crate::ocr::queue::OcrQueueService::new( + queue_service: Arc::new(readur::ocr::queue::OcrQueueService::new( db.clone(), db.pool.clone(), 2 @@ -93,7 +93,7 @@ mod tests { .unwrap_or_else(|_| "postgresql://readur:readur@localhost:5432/readur".to_string()); // Update the app state to include OIDC client - let config = crate::config::Config { + let config = readur::config::Config { database_url: database_url.clone(), server_address: "127.0.0.1:0".to_string(), jwt_secret: "test-secret".to_string(), @@ -124,7 +124,7 @@ mod tests { }; // Connect to the database and run migrations with retry logic for concurrency - let db = crate::db::Database::new(&config.database_url).await.unwrap(); + let db = readur::db::Database::new(&config.database_url).await.unwrap(); // Retry migration up to 3 times to handle concurrent test execution for attempt in 1..=3 { @@ -141,13 +141,13 @@ mod tests { // Create app with OIDC configuration let app = axum::Router::new() - .nest("/api/auth", crate::routes::auth::router()) + .nest("/api/auth", readur::routes::auth::router()) .with_state(Arc::new(AppState { db: db.clone(), config, webdav_scheduler: None, source_scheduler: None, - queue_service: Arc::new(crate::ocr::queue::OcrQueueService::new( + queue_service: Arc::new(readur::ocr::queue::OcrQueueService::new( db.clone(), db.pool.clone(), 2 @@ -249,7 +249,7 @@ mod tests { let database_url = std::env::var("TEST_DATABASE_URL") .or_else(|_| std::env::var("DATABASE_URL")) .unwrap_or_else(|_| "postgresql://readur:readur@localhost:5432/readur".to_string()); - let db = crate::db::Database::new(&database_url).await.unwrap(); + let db = readur::db::Database::new(&database_url).await.unwrap(); // Delete any existing user with the test username or OIDC subject let _ = sqlx::query("DELETE FROM users WHERE username = $1 OR oidc_subject = $2") @@ -377,7 +377,7 @@ mod tests { let database_url = std::env::var("TEST_DATABASE_URL") .or_else(|_| std::env::var("DATABASE_URL")) .unwrap_or_else(|_| "postgresql://readur:readur@localhost:5432/readur".to_string()); - let db = crate::db::Database::new(&database_url).await.unwrap(); + let db = readur::db::Database::new(&database_url).await.unwrap(); // Delete any existing user that might conflict let _ = sqlx::query("DELETE FROM users WHERE username = $1 OR oidc_subject = $2") diff --git a/tests/integration_settings_tests.rs b/tests/integration_settings_tests.rs index be9a296..ecf7a5b 100644 --- a/tests/integration_settings_tests.rs +++ b/tests/integration_settings_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::models::UpdateSettings; - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::models::UpdateSettings; + use readur::test_utils::{TestContext, TestAuthHelper}; use axum::http::StatusCode; use serde_json::json; use tower::util::ServiceExt; diff --git a/tests/integration_sql_type_safety_tests.rs b/tests/integration_sql_type_safety_tests.rs index 05c24f0..91ceaf0 100644 --- a/tests/integration_sql_type_safety_tests.rs +++ b/tests/integration_sql_type_safety_tests.rs @@ -6,7 +6,7 @@ #[cfg(test)] mod tests { - use crate::test_utils::TestContext; + use readur::test_utils::TestContext; use sqlx::Row; use uuid::Uuid; diff --git a/tests/integration_users_tests.rs b/tests/integration_users_tests.rs index 2b0279c..7fd5bf5 100644 --- a/tests/integration_users_tests.rs +++ b/tests/integration_users_tests.rs @@ -1,7 +1,7 @@ #[cfg(test)] mod tests { - use crate::models::{CreateUser, UpdateUser, UserResponse, AuthProvider, UserRole}; - use crate::test_utils::{TestContext, TestAuthHelper}; + use readur::models::{CreateUser, UpdateUser, UserResponse, AuthProvider, UserRole}; + use readur::test_utils::{TestContext, TestAuthHelper}; use axum::http::StatusCode; use serde_json::json; use tower::util::ServiceExt; @@ -110,7 +110,7 @@ mod tests { username: "newuser".to_string(), email: "new@example.com".to_string(), password: "newpassword".to_string(), - role: Some(crate::models::UserRole::User), + role: Some(readur::models::UserRole::User), }; let response = ctx.app diff --git a/tests/migration_constraint_tests.rs b/tests/migration_constraint_tests.rs index 74604f4..6314b4b 100644 --- a/tests/migration_constraint_tests.rs +++ b/tests/migration_constraint_tests.rs @@ -1,4 +1,4 @@ -use crate::test_utils::TestContext; +use readur::test_utils::TestContext; use uuid; #[cfg(test)] diff --git a/tests/migration_integration_tests.rs b/tests/migration_integration_tests.rs index 4bf1c3a..7847cb3 100644 --- a/tests/migration_integration_tests.rs +++ b/tests/migration_integration_tests.rs @@ -1,4 +1,4 @@ -use crate::test_utils::TestContext; +use readur::test_utils::TestContext; use sqlx::Row; use uuid::Uuid;