@@ -797,16 +797,17 @@ def test_ajax_refresh(self):
797
797
798
798
799
799
@unittest .skipUnless (
800
- AsyncRequestFactory is not None , "Test valid only for django with async requests"
800
+ AsyncRequestFactory is not None , "Test valid only for django with async requests"
801
801
)
802
802
@override_settings (DEBUG = True )
803
803
class DebugToolbarAsyncTestCase (BaseTestCase ):
804
-
805
804
@classmethod
806
805
def setUpClass (cls ):
807
806
super ().setUpClass ()
808
807
cls .async_rf = AsyncRequestFactory ()
809
- cls .simple_get_response = lambda * args , ** kwargs : HttpResponse ("<html><body></body></html>" )
808
+ cls .simple_get_response = lambda * args , ** kwargs : HttpResponse (
809
+ "<html><body></body></html>"
810
+ )
810
811
cls ._default_stdout = sys .stdout
811
812
812
813
def setUp (self ):
@@ -823,14 +824,16 @@ def test_do_not_render_toolbar_if_it_was_async_request(self):
823
824
captured_output = io .StringIO ()
824
825
sys .stdout = captured_output
825
826
826
- request = self .async_rf .get ('/' )
827
+ request = self .async_rf .get ("/" )
827
828
response = DebugToolbarMiddleware (self .simple_get_response )(request )
828
829
829
830
self .assertEqual (response .content , b"<html><body></body></html>" )
830
831
831
832
def test_prints_warning_async_is_not_supported (self ):
832
- request = self .async_rf .get ('/' )
833
+ request = self .async_rf .get ("/" )
833
834
DebugToolbarMiddleware (self .simple_get_response )(request )
834
835
835
- assert self .captured_output .getvalue () == "----------\n Be caution, django-debug-toolbar does not support async requests!\n ----------\n "
836
-
836
+ assert (
837
+ self .captured_output .getvalue ()
838
+ == "----------\n Be caution, django-debug-toolbar does not support async requests!\n ----------\n "
839
+ )
0 commit comments