Fixing errors and danger zone

This commit is contained in:
Ian Roddis committed 2026-08-05 14:19:25 -03:00
1 parent 392b79e801
commit 2a0b8fcab2
4 files changed
+12 -14

No files matched your search

+5 -4
View File
@@ -132,20 +132,17 @@ async def test_purge_wipes_domain_data_but_keeps_users_and_odata_config(
FitNote,
ImportedPart,
ScopeModel,
SubPartType,
PartType,
AttachmentPointName,
IsoThread,
UncThread,
ClampConnection,
StaticConnection,
PartColour,
Manufacturer,
):
rows = (await db.execute(Model.__table__.select())).all()
assert rows == [], f"{Model.__name__} should be empty after purge"
# Kept: users, RBAC, and the OData connection config.
# Kept: users, RBAC, the OData connection config, and part taxonomy.
from app.crud import user as user_crud
assert await user_crud.get_by_email(db, "root@example.com") is not None
@@ -153,5 +150,9 @@ async def test_purge_wipes_domain_data_but_keeps_users_and_odata_config(
assert config is not None
assert config.odata_url == "https://example.test/odata"
for Model in (PartColour, PartType, SubPartType):
rows = (await db.execute(Model.__table__.select())).all()
assert rows != [], f"{Model.__name__} should survive the purge"
entries = await audit_crud.list_recent(db)
assert any("Purged all domain data" in e.description for e in entries)