From 0a6b7db9abf6ec8a9d46c410d2c8983fefba2744 Mon Sep 17 00:00:00 2001 From: Desel72 Date: Tue, 24 Mar 2026 15:10:40 +0000 Subject: [PATCH] fix: inline account/tenant creation instead of nonexistent helper --- .../services/test_app_service.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/api/tests/test_containers_integration_tests/services/test_app_service.py b/api/tests/test_containers_integration_tests/services/test_app_service.py index 6a01f1c073..e20e861b18 100644 --- a/api/tests/test_containers_integration_tests/services/test_app_service.py +++ b/api/tests/test_containers_integration_tests/services/test_app_service.py @@ -1300,9 +1300,12 @@ class TestAppService: """Test get_paginate_apps returns None when tag_ids filter yields no matches.""" from services.app_service import AppService - account, tenant = self._create_test_app_and_account( - db_session_with_containers, mock_external_service_dependencies + fake = Faker() + account = AccountService.create_account( + email=fake.email(), name=fake.name(), interface_language="en-US", password=generate_valid_password(fake) ) + TenantService.create_owner_tenant_if_not_exist(account, name=fake.company()) + tenant = account.current_tenant args = {"tag_ids": [], "page": 1, "limit": 10} result = AppService().get_paginate_apps(account.id, tenant.id, args) @@ -1313,10 +1316,14 @@ class TestAppService: ): """Test update_app keeps the existing icon_type when the payload omits it.""" from models.model import IconType + from services.app_service import AppService - account, tenant = self._create_test_app_and_account( - db_session_with_containers, mock_external_service_dependencies + fake = Faker() + account = AccountService.create_account( + email=fake.email(), name=fake.name(), interface_language="en-US", password=generate_valid_password(fake) ) + TenantService.create_owner_tenant_if_not_exist(account, name=fake.company()) + tenant = account.current_tenant app_service = AppService() app = app_service.create_app( tenant.id, @@ -1353,9 +1360,14 @@ class TestAppService: self, db_session_with_containers: Session, mock_external_service_dependencies ): """Test update_app rejects an explicit empty icon_type.""" - account, tenant = self._create_test_app_and_account( - db_session_with_containers, mock_external_service_dependencies + from services.app_service import AppService + + fake = Faker() + account = AccountService.create_account( + email=fake.email(), name=fake.name(), interface_language="en-US", password=generate_valid_password(fake) ) + TenantService.create_owner_tenant_if_not_exist(account, name=fake.company()) + tenant = account.current_tenant app_service = AppService() app = app_service.create_app( tenant.id,