From 5d79b4f613e8b2d70b4828d8bc83d76a46e738d3 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Thu, 23 Jul 2026 17:18:38 +0200 Subject: [PATCH] Phase 1B: Unify plugins from company to contact --- tests/test_companies.py | 2 +- tests/test_entity_links.py | 2 +- tests/test_tags.py | 4 ++-- tests/test_tenant.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_companies.py b/tests/test_companies.py index da0b690..665ce60 100644 --- a/tests/test_companies.py +++ b/tests/test_companies.py @@ -328,7 +328,7 @@ class TestCompanyAuditAndSoftDelete: json={"name": "Audited Corp"}, headers=ORIGIN_HEADER, ) - q = select(AuditLog).where(AuditLog.entity_type == "company", AuditLog.action == "create") + q = select(AuditLog).where(AuditLog.entity_type == "contact", AuditLog.action == "create") result = await db_session.execute(q) entries = result.scalars().all() assert len(entries) >= 1 diff --git a/tests/test_entity_links.py b/tests/test_entity_links.py index 466dad2..7e89652 100644 --- a/tests/test_entity_links.py +++ b/tests/test_entity_links.py @@ -185,7 +185,7 @@ async def test_reverse_link_company_files(authed_client: AsyncClient): file_id = str(uuid.uuid4()) await client.post( f"/api/v1/dms/files/{file_id}/link", - json={"entity_type": "company", "entity_id": company_id}, + json={"entity_type": "contact", "entity_id": company_id}, headers=ORIGIN_HEADER, ) diff --git a/tests/test_tags.py b/tests/test_tags.py index ed30b5d..c66762e 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -136,7 +136,7 @@ async def test_delete_tag_cascade(authed_client: AsyncClient): entity_id = str(uuid.uuid4()) resp = await authed_client.post( "/api/v1/tags/assign", - json={"tag_id": tag_id, "entity_type": "company", "entity_id": entity_id}, + json={"tag_id": tag_id, "entity_type": "contact", "entity_id": entity_id}, headers=ORIGIN_HEADER, ) assert resp.status_code == 200 @@ -248,7 +248,7 @@ async def test_list_tag_entities(authed_client: AsyncClient): for eid in entity_ids: await authed_client.post( "/api/v1/tags/assign", - json={"tag_id": tag_id, "entity_type": "company", "entity_id": eid}, + json={"tag_id": tag_id, "entity_type": "contact", "entity_id": eid}, headers=ORIGIN_HEADER, ) diff --git a/tests/test_tenant.py b/tests/test_tenant.py index 6fa241c..f91b46e 100644 --- a/tests/test_tenant.py +++ b/tests/test_tenant.py @@ -219,7 +219,7 @@ class TestAuditLog: # Check audit_log table from sqlalchemy import select as sel - q = sel(AuditLog).where(AuditLog.entity_type == "company", AuditLog.action == "create") + q = sel(AuditLog).where(AuditLog.entity_type == "contact", AuditLog.action == "create") result = await db_session.execute(q) entries = result.scalars().all() assert len(entries) >= 1 @@ -237,7 +237,7 @@ class TestAuditLog: from sqlalchemy import select as sel - q = sel(AuditLog).where(AuditLog.entity_type == "company", AuditLog.action == "update") + q = sel(AuditLog).where(AuditLog.entity_type == "contact", AuditLog.action == "update") result = await db_session.execute(q) entries = result.scalars().all() assert len(entries) >= 1 @@ -254,7 +254,7 @@ class TestAuditLog: from sqlalchemy import select as sel - q = sel(AuditLog).where(AuditLog.entity_type == "company", AuditLog.action == "delete") + q = sel(AuditLog).where(AuditLog.entity_type == "contact", AuditLog.action == "delete") result = await db_session.execute(q) entries = result.scalars().all() assert len(entries) >= 1