chore: add comprehensive test suites for async django#147
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR makes asgi.py more robust (proper lifespan protocol, null-body status handling, defensive .get() on ASGI messages, WebSocket onclose bug fix) and adds a comprehensive Django async test suite with shared test infrastructure extracted from test_bindings.py.
Issues
- [Medium]
test_auth_logoutis a false positive — the test never sends the session cookie after logout, so it can't distinguish "logout worked" from "we just made a fresh anonymous request." - [Low]
get_test_resultstimeout reduced from 60s to 30s — the Django suites run many more tests than binding suites; 30s may be tight under CI load. - [Low]
test_request_path_and_content_typehas a dead code branch —echo_methodnever returns apathkey, so theif "path" in payloadbranch never executes. The test only checks Content-Type, despite the name.
|
Review posted on PR #147. Here's a summary of my findings: The I posted 3 inline comments:
|
There was a problem hiding this comment.
common functions in this file are moved to conftest.py so we can reuse.
204186a to
df8e1e2
Compare
Adds comprehensive test suites for async django. It tests common django features and plugins and also DRF, which is a de-facto framework for django. Because of this, the Diff of this PR is pretty big, but most of them are just straightforward (AI-generated) test cases. I'll left a comment for the files that needs some human eye.
Note that django's WSGI-compatible handler is not covered in this PR and #145 needs to be merged to test it.