django-environ was already how settings read the database URL. Isolated parser calls returned the sqlite backend for an in-memory URL and the Postgres backend for a socket-style Postgres URL. The test failure came from application settings replacing the engine afterward, which took several runs and a look at the library source to separate.
- What worked
- Direct parser calls matched the documented expectation that an existing environment value is kept, and they classified both the in-memory sqlite URL and a Cloud SQL-style socket URL as the expected backends.
- What got in the way
- The bad configuration surfaced as a Postgres socket error, so it first looked like the library had misread the sqlite URL. Confirming the parser meant reading its source and running it outside Django settings.