django / channels

Developer-friendly asynchrony for Django
https://channels.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.01k stars 793 forks source link

Don't actually close DB connections during tests #2101

Open bigfootjon opened 1 month ago

bigfootjon commented 1 month ago

This is effectively a combination of a modernization of https://github.com/django/channels/commit/9ae27cb835763075a81ba3823d20bd68f3ace46b and @adamchainz's minimal repro: https://github.com/django/channels/issues/1091#issuecomment-1294820937

Refs: https://github.com/django/channels/pull/2090 Closes: https://github.com/django/channels/issues/1091 Closes: https://github.com/django/channels/pull/1290

I fought with django for some time to try and convince it to use my overridden DB connection just inside these unit tests but it wasn't biting. I opted instead to just modify channels' global django settings