[Chore-1105] Migrate integration tests to shared fixtures

Story 1105Epic None21 files · +1743/−3725

PR #284 · pramaan-io/pramaan-functions · merged 2026-06-09

Why this matters

Twenty test files, twenty copies of the same user-and-firm setup — one rename away from silent chaos.

When test infrastructure is duplicated, the tests become the hardest thing to change.

Twenty copies, nineteen wrong, zero alarms.

The fix — One pantry, twenty recipes, zero drift.

How it flows

sequenceDiagram
  autonumber
  participant test as Test file
  participant factories as tests/factories.py
  participant conftest as tests/integration/conftest.py
  test->>factories: call factory
  factories->>test: user / firm / client
  conftest->>test: JWT + cleanup (auto)
  test->>test: scenario helpers stay local

Files changed (21)

File±
tests/factories.py+264 −15
tests/integration/test_adr054_auth.py+73 −143
tests/integration/test_app_annotations.py+50 −159
tests/integration/test_app_claim_block_refs.py+24 −158
tests/integration/test_app_claim_rbr_links.py+24 −154
tests/integration/test_app_claims.py+27 −151
tests/integration/test_app_document_blocks.py+24 −150
tests/integration/test_app_documents.py+29 −157
tests/integration/test_app_filing_types.py+54 −195
tests/integration/test_app_firm_audit.py+143 −200
tests/integration/test_app_firm_routes.py+326 −340
tests/integration/test_app_forums.py+68 −147
tests/integration/test_app_matter_redesign.py+56 −167
tests/integration/test_app_matters.py+84 −209
tests/integration/test_app_me.py+95 −204
tests/integration/test_app_participant_labels.py+24 −165
tests/integration/test_app_proceeding_types.py+24 −172
tests/integration/test_app_rbrs.py+19 −162
tests/integration/test_app_seats_and_billing.py+203 −328
tests/integration/test_app_support_grants.py+108 −195
tests/integration/test_app_validation_checks.py+24 −154