          self.assertEqual(site, s1)
  
          # Host header with non-matching domain
          request.META = {'HTTP_HOST': 'example.net'}
          self.assertRaises(ObjectDoesNotExist, get_current_site, request)
  
          # Ensure domain for RequestSite always matches host header
          with self.modify_settings(INSTALLED_APPS={'remove': 'django.contrib.sites'}):
              request.META = {'HTTP_HOST': 'example.com'}
              site = get_current_site(request)
 
</s> remove         self.assertRaises(ObjectDoesNotExist, get_current_site, request)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request) </s> remove         self.assertRaises(ValidationError, site.full_clean)
 </s> add         with self.assertRaises(ValidationError):
            site.full_clean() </s> remove         self.assertRaises(ObjectDoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            Site.objects.get_current() </s> remove         self.assertRaises(ImproperlyConfigured, get_user, request)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            get_user(request) </s> remove         self.assertRaises(ValidationError, site.full_clean)
 </s> add         with self.assertRaises(ValidationError):
            site.full_clean()
        with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
          self.assertEqual(site, s1)
  
          # Host header with non-matching domain
          request.META = {'HTTP_HOST': 'example.net'}
        with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
  
          # Ensure domain for RequestSite always matches host header
          with self.modify_settings(INSTALLED_APPS={'remove': 'django.contrib.sites'}):
              request.META = {'HTTP_HOST': 'example.com'}
              site = get_current_site(request)
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