fix: update 61 outdated test mocks to match current schemas
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 41s
CI/CD / test-python-backend-compliance (push) Successful in 31s
CI/CD / test-python-document-crawler (push) Successful in 21s
CI/CD / test-python-dsms-gateway (push) Successful in 16s
CI/CD / validate-canonical-controls (push) Successful in 10s
CI/CD / Deploy (push) Successful in 4s

Tests were failing due to stale mock objects after schema extensions:
- DSFA: add _mapping property to _DictRow, use proper mock instead of MagicMock
- Company Profile: add 6 missing fields (project_id, offering_urls, etc.)
- Legal Templates/Policy: update document type count 52→58
- VVT: add 13 missing attributes to activity mock
- Legal Documents: align consent test assertions with production behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-24 06:40:42 +01:00
parent 2efc738803
commit cce2707c03
7 changed files with 82 additions and 21 deletions

View File

@@ -50,7 +50,7 @@ class TestRowToResponse:
"""Tests for DB row to response conversion."""
def _make_row(self, **overrides):
"""Create a mock DB row with 40 fields (matching row_to_response indices)."""
"""Create a mock DB row with 46 fields (matching _BASE_COLUMNS_LIST order)."""
defaults = [
"uuid-123", # 0: id
"default", # 1: tenant_id
@@ -93,6 +93,13 @@ class TestRowToResponse:
False, # 37: subject_to_iso27001
None, # 38: supervisory_authority
12, # 39: review_cycle_months
# Additional fields (indices 40-45)
None, # 40: project_id
{}, # 41: offering_urls
"", # 42: headquarters_country_other
"", # 43: headquarters_street
"", # 44: headquarters_zip
"", # 45: headquarters_state
]
return tuple(defaults)