From e6790d9b81afef32d8b182307246da7b1fea98f6 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Thu, 20 Aug 2026 13:56:52 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20punkt=2010=20(performance)=20=E2=80=94?= =?UTF-8?q?=20fix=20test=20field=20names=20(firstname/surname)=20and=20ent?= =?UTF-8?q?ity=20types=20(contact/company/attachment),=208/8=20permission?= =?UTF-8?q?=20perf=20tests=20pass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_permission_performance.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_permission_performance.py b/tests/test_permission_performance.py index bd8a2e8..bda6321 100644 --- a/tests/test_permission_performance.py +++ b/tests/test_permission_performance.py @@ -36,8 +36,8 @@ class TestPermissionPerformance: contacts.append(Contact( tenant_id=tenant_id, type="person", - first_name=f"Perf{i}", - last_name=f"Test{i}", + firstname=f"Perf{i}", + surname=f"Test{i}", owner_id=user_id, created_by=user_id, updated_by=user_id, @@ -73,8 +73,8 @@ class TestPermissionPerformance: contacts.append(Contact( tenant_id=tenant_id, type="person", - first_name=f"Cache{i}", - last_name=f"Test{i}", + firstname=f"Cache{i}", + surname=f"Test{i}", owner_id=user_id, created_by=user_id, updated_by=user_id, @@ -114,8 +114,8 @@ class TestPermissionPerformance: contacts.append(Contact( tenant_id=tenant_id, type="person", - first_name=f"Batch{i}", - last_name=f"Test{i}", + firstname=f"Batch{i}", + surname=f"Test{i}", owner_id=user_id, created_by=user_id, updated_by=user_id, @@ -145,7 +145,7 @@ class TestPermissionPerformance: user_id = seed["admin_a"].id # Populate cache for multiple entity types - for entity_type in ["contact", "dms_file", "mailbox", "calendar_event", "task"]: + for entity_type in ["contact", "company", "attachment", "entity_attachment", "workflow"]: await eps.get_cached_visible_ids( db_session, redis_client, tenant_id, user_id, entity_type ) @@ -158,7 +158,7 @@ class TestPermissionPerformance: assert elapsed < 1.0, f"Cache invalidation took {elapsed:.3f}s (expected <1.0s)" # Verify cache is cleared - for entity_type in ["contact", "dms_file", "mailbox", "calendar_event", "task"]: + for entity_type in ["contact", "company", "attachment", "entity_attachment", "workflow"]: cache_key = f"ep_vis:{user_id}:{tenant_id}:{entity_type}" cached = await redis_client.get(cache_key) assert cached is None, f"Cache for {entity_type} should be cleared" @@ -254,13 +254,13 @@ class TestPermissionPerformance: for i in range(500): contacts.append(Contact( tenant_id=tenant_id, type="person", - first_name=f"Owned{i}", last_name=f"Test{i}", + firstname=f"Owned{i}", surname=f"Test{i}", owner_id=owner_id, created_by=owner_id, updated_by=owner_id, )) for i in range(300): contacts.append(Contact( tenant_id=tenant_id, type="person", - first_name=f"Tenant{i}", last_name=f"Test{i}", + firstname=f"Tenant{i}", surname=f"Test{i}", owner_id=None, created_by=owner_id, updated_by=owner_id, )) db_session.add_all(contacts)