          # Prepare a request object
          request = HttpRequest()
          request.session = self.client.session
  
          self.assertRaises(ImproperlyConfigured, get_user, request)
  
  
  class ImportedModelBackend(ModelBackend):
      pass
  
 
</s> remove         self.assertRaises(signing.BadSignature,
            request.get_signed_cookie, 'c')
 </s> add         with self.assertRaises(signing.BadSignature):
            request.get_signed_cookie('c') </s> remove         self.assertRaises(signing.BadSignature,
            request.get_signed_cookie, 'a', salt='two')
 </s> add         with self.assertRaises(signing.BadSignature):
            request.get_signed_cookie('a', salt='two') </s> remove         self.assertRaises(PermissionDenied, AView.as_view(), request)
 </s> add         with self.assertRaises(PermissionDenied):
            AView.as_view()(request) </s> remove         self.assertRaises(PermissionDenied, AView.as_view(), request)
 </s> add         with self.assertRaises(PermissionDenied):
            AView.as_view()(request) </s> remove         self.assertRaises(PermissionDenied, a_view, request)
 </s> add         with self.assertRaises(PermissionDenied):
            a_view(request)
        with self.assertRaises(ImproperlyConfigured):
            get_user(request)
          # Prepare a request object
          request = HttpRequest()
          request.session = self.client.session
  
        with self.assertRaises(ImproperlyConfigured):
            get_user(request)
  
  
  class ImportedModelBackend(ModelBackend):
      pass
  
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/auth_tests/test_auth_backends.py