              self.assertEqual(reverse('prefixed'), '/%s/prefixed/' % settings.LANGUAGE_CODE)
  
      @override_settings(ROOT_URLCONF='i18n.patterns.urls.wrong')
      def test_invalid_prefix_use(self):
          with self.assertRaises(ImproperlyConfigured):
              reverse('account:register')
  
  
  @override_settings(ROOT_URLCONF='i18n.patterns.urls.disabled')
  class URLDisabledTests(URLTestCaseBase):
 
</s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = "'apps.apps.NotAConfig' isn't a subclass of AppConfig."
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = (
            'No authentication backends have been defined. '
            'Does AUTHENTICATION_BACKENDS contain anything?'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         with self.assertRaisesMessage(ValueError, self.msg % 'first_name'): </s> remove         with self.assertRaises(TypeError):
 </s> add         with self.assertRaisesMessage(TypeError, msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         with self.assertRaisesMessage(ValueError, self.msg % 'accounts'):
        msg = 'Using i18n_patterns in an included URLconf is not allowed.'
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
              self.assertEqual(reverse('prefixed'), '/%s/prefixed/' % settings.LANGUAGE_CODE)
  
      @override_settings(ROOT_URLCONF='i18n.patterns.urls.wrong')
      def test_invalid_prefix_use(self):
        msg = 'Using i18n_patterns in an included URLconf is not allowed.'
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
              reverse('account:register')
  
  
  @override_settings(ROOT_URLCONF='i18n.patterns.urls.disabled')
  class URLDisabledTests(URLTestCaseBase):
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/i18n/patterns/tests.py