Files
Bennett WoodsandClaude Opus 5 6d124dfdcc fix(test-api): delete e2e orgs before their members
Migration 0014 added the deferred organization_has_members constraint
trigger, which rejects any transaction that leaves a live organization
with no members. seed_data deleted the seeded users first, cascading to
their OrganizationUser rows and orphaning the previous run's
organization, so every seed after the first raised IntegrityError:

  [23514] organization 1 cannot be left without members;
  delete the organization instead

Every frontend e2e spec seeds in `beforeEach`, so the second request in
the first spec failed and took the run with it: 10 of 12 specs, 15
tests. Delete the organizations first instead — the guard accepts that
because the organization row is gone by commit time. Orgs the seeded
users belong to are matched alongside the name-matched ones, so a test
org missing `e2etestobj` in its name can't wedge the next seed either.

The existing test seeded once and passed throughout. The new cases seed
twice and need TransactionTestCase, since a deferred trigger only fires
on a real commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 09:57:45 -04:00
..
2020-03-28 17:26:46 +00:00
2024-08-20 13:49:49 -04:00