          self.assertRaises(ImproperlyConfigured, finders.FileSystemFinder)
  
      @override_settings(MEDIA_ROOT='')
      def test_location_empty(self):
          self.assertRaises(ImproperlyConfigured, finders.DefaultStorageFinder)
 
</s> remove         self.assertRaises(ImproperlyConfigured, finders.FileSystemFinder)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            finders.FileSystemFinder() </s> remove         self.assertRaises(AttributeError, self.client.get, '/detail/author/invalid/url/')
 </s> add         with self.assertRaises(AttributeError):
            self.client.get('/detail/author/invalid/url/') </s> remove         self.assertRaises(ImproperlyConfigured, lambda: reverse('account:register'))
 </s> add         with self.assertRaises(ImproperlyConfigured):
            reverse('account:register') </s> remove         self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            ops.spatial_version </s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/detail/author/invalid/qs/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/detail/author/invalid/qs/')
        with self.assertRaises(ImproperlyConfigured):
            finders.DefaultStorageFinder()
          self.assertRaises(ImproperlyConfigured, finders.FileSystemFinder)
  
      @override_settings(MEDIA_ROOT='')
      def test_location_empty(self):
        with self.assertRaises(ImproperlyConfigured):
            finders.DefaultStorageFinder()
keep keep keep keep replace
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/staticfiles_tests/test_finders.py