  
          # Test that an exception is raised if the sites framework is installed
          # but there is no matching Site
          site.delete()
          self.assertRaises(ObjectDoesNotExist, get_current_site, request)
  
          # A RequestSite is returned if the sites framework is not installed
          with self.modify_settings(INSTALLED_APPS={'remove': 'django.contrib.sites'}):
              site = get_current_site(request)
              self.assertIsInstance(site, RequestSite)
 
</s> remove         self.assertRaises(ObjectDoesNotExist, get_current_site, request)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request) </s> remove         self.assertRaises(ImproperlyConfigured, Sitemap().get_urls)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            Sitemap().get_urls() </s> remove         self.assertRaises(Site.DoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(Site.DoesNotExist):
            Site.objects.get_current() </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(DatabaseError, self.column_classes, new_field.remote_field.through)
 </s> add         with self.assertRaises(DatabaseError):
            self.column_classes(new_field.remote_field.through)
        with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
  
          # Test that an exception is raised if the sites framework is installed
          # but there is no matching Site
          site.delete()
        with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
  
          # A RequestSite is returned if the sites framework is not installed
          with self.modify_settings(INSTALLED_APPS={'remove': 'django.contrib.sites'}):
              site = get_current_site(request)
              self.assertIsInstance(site, RequestSite)
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/sites_tests/tests.py