-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add warning async is not supported #1911
Conversation
@@ -792,3 +794,46 @@ def test_ajax_refresh(self): | |||
) | |||
self.assertNotIn("/ajax/", history_panel.text) | |||
self.assertIn("/json_view/", history_panel.text) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from django.test import AsyncRequestFactory | |
https://docs.djangoproject.com/en/stable/topics/testing/advanced/#asyncrequestfactory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the tip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must move that line up near the top of the file with the other imports.
Modify line 16 to read from django.test import AsyncRequestFactory, RequestFactory
As far as I see the problem would become irrelevant soon, after #1933 If so, feel free to close this PR |
tests/test_integration.py
Outdated
try: | ||
from django.test import AsyncRequestFactory | ||
except ImportError: | ||
AsyncRequestFactory = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AsyncRequestFactory
is defined in Django >= v3.1 so the ImportError
should not happen on all supported versions of Django.
Just modify line 16 to read from django.test import AsyncRequestFactory, RequestFactory
Sorry @denisSurkov as you mentioned #1938 should make this work unnecessary. It should be merged in the next few weeks so I think we can put this to rest for the time being. I appreciate your help and desire to make the toolbar a better library! If you're looking to contribute, there are several things that could be improved. If you're async focused, #1938 has identified several panels that are async incompatible ( |
Description
Add warning async is not supported.
Fixes #1845
Checklist:
docs/changes.rst
.