          versions = ['nope', '123']
  
          for version in versions:
              ops = FakePostGISOperations(version)
              self.assertRaises(Exception, lambda: ops.spatial_version)
  
      def test_no_version_number(self):
          ops = FakePostGISOperations()
          self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
 
</s> remove         self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
 </s> add         with self.assertRaises(ImproperlyConfigured):
            ops.spatial_version </s> remove             self.assertRaises(School.DoesNotExist, lambda: private_director.school)
 </s> add             with self.assertRaises(School.DoesNotExist):
                private_director.school </s> remove             self.assertRaises(Director.DoesNotExist, lambda: private_school.director)
 </s> add             with self.assertRaises(Director.DoesNotExist):
                private_school.director </s> remove         self.assertRaises(ContentNotRenderedError, lambda: response.content)
 </s> add         with self.assertRaises(ContentNotRenderedError):
            response.content </s> remove         self.assertRaises(ImproperlyConfigured, lambda: reverse('account:register'))
 </s> add         with self.assertRaises(ImproperlyConfigured):
            reverse('account:register')
            with self.assertRaises(Exception):
                ops.spatial_version
          versions = ['nope', '123']
  
          for version in versions:
              ops = FakePostGISOperations(version)
            with self.assertRaises(Exception):
                ops.spatial_version
  
      def test_no_version_number(self):
          ops = FakePostGISOperations()
          self.assertRaises(ImproperlyConfigured, lambda: ops.spatial_version)
keep keep keep keep replace keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/tests.py