Blog Posts

Most Popular Blog Tags

Mocking ASGI Scope in WSGI Requests when Testing Django Async Views

Django channels are great for asynchronous views, but they can be a headache to test. This is due to the incompatibility with database transactions and all the side effects that the incompatibility produces. For example, the common pattern of rolling back the database after tests does not work, the data remains there which makes other tests fail as test outputs become flaky.

Shynet