Phase 1B: Unify plugins from company to contact
This commit is contained in:
@@ -328,7 +328,7 @@ class TestCompanyAuditAndSoftDelete:
|
|||||||
json={"name": "Audited Corp"},
|
json={"name": "Audited Corp"},
|
||||||
headers=ORIGIN_HEADER,
|
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)
|
result = await db_session.execute(q)
|
||||||
entries = result.scalars().all()
|
entries = result.scalars().all()
|
||||||
assert len(entries) >= 1
|
assert len(entries) >= 1
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ async def test_reverse_link_company_files(authed_client: AsyncClient):
|
|||||||
file_id = str(uuid.uuid4())
|
file_id = str(uuid.uuid4())
|
||||||
await client.post(
|
await client.post(
|
||||||
f"/api/v1/dms/files/{file_id}/link",
|
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,
|
headers=ORIGIN_HEADER,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -136,7 +136,7 @@ async def test_delete_tag_cascade(authed_client: AsyncClient):
|
|||||||
entity_id = str(uuid.uuid4())
|
entity_id = str(uuid.uuid4())
|
||||||
resp = await authed_client.post(
|
resp = await authed_client.post(
|
||||||
"/api/v1/tags/assign",
|
"/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,
|
headers=ORIGIN_HEADER,
|
||||||
)
|
)
|
||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
@@ -248,7 +248,7 @@ async def test_list_tag_entities(authed_client: AsyncClient):
|
|||||||
for eid in entity_ids:
|
for eid in entity_ids:
|
||||||
await authed_client.post(
|
await authed_client.post(
|
||||||
"/api/v1/tags/assign",
|
"/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,
|
headers=ORIGIN_HEADER,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ class TestAuditLog:
|
|||||||
# Check audit_log table
|
# Check audit_log table
|
||||||
from sqlalchemy import select as sel
|
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)
|
result = await db_session.execute(q)
|
||||||
entries = result.scalars().all()
|
entries = result.scalars().all()
|
||||||
assert len(entries) >= 1
|
assert len(entries) >= 1
|
||||||
@@ -237,7 +237,7 @@ class TestAuditLog:
|
|||||||
|
|
||||||
from sqlalchemy import select as sel
|
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)
|
result = await db_session.execute(q)
|
||||||
entries = result.scalars().all()
|
entries = result.scalars().all()
|
||||||
assert len(entries) >= 1
|
assert len(entries) >= 1
|
||||||
@@ -254,7 +254,7 @@ class TestAuditLog:
|
|||||||
|
|
||||||
from sqlalchemy import select as sel
|
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)
|
result = await db_session.execute(q)
|
||||||
entries = result.scalars().all()
|
entries = result.scalars().all()
|
||||||
assert len(entries) >= 1
|
assert len(entries) >= 1
|
||||||
|
|||||||
Reference in New Issue
Block a user