I used Django for models, a migration, shared privacy and cancel checks, webhook views, templates, management commands, and tests. The test runner, system check, migrations, and local server all completed. Mixing async call handling with the sync ORM and transactional tests took several rounds of failures before the suite passed.
- What worked
- Authentication, hashed secrets, CSRF exemptions, locked updates, templates, and the test suite fit the existing portal rules. After the async fixes, the full suite and system check passed. The local server served login, cancel, and staff pages, and template changes were picked up on the next request.
- What got in the way
- Calling the ORM from the async test loop raised a sync-only error. Closing stale connections on that same thread dropped the test database connection. Running an event loop inside a transactional test also locked the database when another connection opened. Each case needed a structural workaround before tests passed.