      def setUp(self):
          self.user = User.objects.create_user('test', 'test@example.com', 'test')
  
      def test_raises_exception(self):
          self.assertRaises(ImproperlyConfigured, self.user.has_perm, ('perm', TestObj(),))
  
  
  @override_settings(AUTHENTICATION_BACKENDS=['auth_tests.test_auth_backends.SimpleRowlevelBackend'])
  class InActiveUserBackendTest(TestCase):
      """
 
</s> remove         self.assertRaises(TypeError, authenticate, username='test', password='test')
 </s> add         with self.assertRaises(TypeError):
            authenticate(username='test', password='test') </s> remove         self.assertRaises(BadHeaderError, r.__setitem__, 'test\rstr', 'test')
        self.assertRaises(BadHeaderError, r.__setitem__, 'test\nstr', 'test')
 </s> add         with self.assertRaises(BadHeaderError):
            r.__setitem__('test\rstr', 'test')
        with self.assertRaises(BadHeaderError):
            r.__setitem__('test\nstr', 'test') </s> remove         self.assertRaises(PermissionDenied, a_view, request)
 </s> add         with self.assertRaises(PermissionDenied):
            a_view(request) </s> remove         self.assertRaises(ImportError, import_module,
            'utils_tests.test_no_submodule.anything')
 </s> add         with self.assertRaises(ImportError):
            import_module('utils_tests.test_no_submodule.anything') </s> remove         self.assertRaises(AttributeError, getattr, settings, 'TEST')
        self.assertRaises(AttributeError, getattr, settings, 'TEST2')
 </s> add         with self.assertRaises(AttributeError):
            getattr(settings, 'TEST')
        with self.assertRaises(AttributeError):
            getattr(settings, 'TEST2')
        with self.assertRaises(ImproperlyConfigured):
            self.user.has_perm(('perm', TestObj()))
      def setUp(self):
          self.user = User.objects.create_user('test', 'test@example.com', 'test')
  
      def test_raises_exception(self):
        with self.assertRaises(ImproperlyConfigured):
            self.user.has_perm(('perm', TestObj()))
  
  
  @override_settings(AUTHENTICATION_BACKENDS=['auth_tests.test_auth_backends.SimpleRowlevelBackend'])
  class InActiveUserBackendTest(TestCase):
      """
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