          self._add_middleware(post_middleware)
          self._add_middleware(bad_middleware)
          self._add_middleware(pre_middleware)
          self.assert_exceptions_handled('/middleware_exceptions/null_view/', [
                  "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.",
                  'Test Response Exception'
          ])
  
          # Check that the right middleware methods have been invoked
          self.assert_middleware_usage(pre_middleware,  True, True, False, False, False)
          self.assert_middleware_usage(bad_middleware,  True, True, False, True,  False)
 
</s> remove                 "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.",
 </s> add             "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.", </s> remove                 "The view middleware_exceptions.views.null_view didn't return an HttpResponse object."
 </s> add             "The view middleware_exceptions.views.null_view didn't return an HttpResponse object." </s> remove                 "The view middleware_exceptions.views.null_view didn't return an HttpResponse object."
 </s> add             "The view middleware_exceptions.views.null_view didn't return an HttpResponse object." </s> remove                 data={'description': 'Assistance'},
                files={'file': SimpleUploadedFile('test-maxlength.txt', b'hello world')})
 </s> add             data={'description': 'Assistance'},
            files={'file': SimpleUploadedFile('test-maxlength.txt', b'hello world')}) </s> remove         'show_save_and_add_another': context['has_add_permission'] and
                            not is_popup and (not save_as or context['add']),
 </s> add         'show_save_and_add_another': context['has_add_permission'] and not is_popup and (not save_as or context['add']),
            "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.",
            'Test Response Exception'
          self._add_middleware(post_middleware)
          self._add_middleware(bad_middleware)
          self._add_middleware(pre_middleware)
          self.assert_exceptions_handled('/middleware_exceptions/null_view/', [
            "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.",
            'Test Response Exception'
            "The view middleware_exceptions.views.null_view didn't return an HttpResponse object.",
            'Test Response Exception'
          ])
  
          # Check that the right middleware methods have been invoked
          self.assert_middleware_usage(pre_middleware,  True, True, False, False, False)
          self.assert_middleware_usage(bad_middleware,  True, True, False, True,  False)
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21288 -- Fixed E126 pep8 warnings 
tests/middleware_exceptions/tests.py