          """
          Exception is raised when trying to register an abstract model.
          Refs #12004.
          """
          self.assertRaises(ImproperlyConfigured, self.site.register, Location)
  
      def test_is_registered_model(self):
          "Checks for registered models should return true."
          self.site.register(Person)
          self.assertTrue(self.site.is_registered(Person))
 
</s> remove         self.assertRaises(CommandError, management.call_command, ('explode',))
 </s> add         with self.assertRaises(CommandError):
            management.call_command(('explode',)) </s> remove         self.assertRaises(admin.sites.AlreadyRegistered,
                          self.site.register,
                          Person)
 </s> add         with self.assertRaises(admin.sites.AlreadyRegistered):
            self.site.register(Person) </s> remove         self.assertRaises(ValueError, NoModelModelForm)
 </s> add         with self.assertRaises(ValueError):
            NoModelModelForm() </s> remove         self.assertRaises(ImproperlyConfigured,
                          self.client.get,
                          '/syndication/articles/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/syndication/articles/') </s> remove         self.assertRaises(ImproperlyConfigured, Sitemap().get_urls)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            Sitemap().get_urls()
        with self.assertRaises(ImproperlyConfigured):
            self.site.register(Location)
          """
          Exception is raised when trying to register an abstract model.
          Refs #12004.
          """
        with self.assertRaises(ImproperlyConfigured):
            self.site.register(Location)
  
      def test_is_registered_model(self):
          "Checks for registered models should return true."
          self.site.register(Person)
          self.assertTrue(self.site.is_registered(Person))
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/admin_registration/tests.py