          # Make sure that get_current() does not return a deleted Site object.
          s = Site.objects.get_current()
          self.assertIsInstance(s, Site)
          s.delete()
          self.assertRaises(ObjectDoesNotExist, Site.objects.get_current)
  
      def test_site_cache(self):
          # After updating a Site object (e.g. via the admin), we shouldn't return a
          # bogus value from the SITE_CACHE.
          site = Site.objects.get_current()
 
</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, Sitemap().get_urls)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            Sitemap().get_urls() </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(TypeError, lambda: p['has_previous'])
 </s> add         with self.assertRaises(TypeError):
            p['has_previous']
        with self.assertRaises(ObjectDoesNotExist):
            Site.objects.get_current()
          # Make sure that get_current() does not return a deleted Site object.
          s = Site.objects.get_current()
          self.assertIsInstance(s, Site)
          s.delete()
        with self.assertRaises(ObjectDoesNotExist):
            Site.objects.get_current()
  
      def test_site_cache(self):
          # After updating a Site object (e.g. via the admin), we shouldn't return a
          # bogus value from the SITE_CACHE.
          site = Site.objects.get_current()
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