      def test_init(self):
          "Testing GeometryField initialization with defaults."
          fld = forms.GeometryField()
          for bad_default in ('blah', 3, 'FoO', None, 0):
              self.assertRaises(ValidationError, fld.clean, bad_default)
  
      def test_srid(self):
          "Testing GeometryField with a SRID set."
          # Input that doesn't specify the SRID is assumed to be in the SRID
          # of the input field.
 
</s> remove         self.assertRaises(TypeError, qs.kml, 'name')
 </s> add         with self.assertRaises(TypeError):
            qs.kml('name') </s> remove         self.assertRaises(AttributeError, A, banana=100)
 </s> add         with self.assertRaises(AttributeError):
            A(banana=100) </s> remove         self.assertRaises(AttributeError, D, banana=100)
 </s> add         with self.assertRaises(AttributeError):
            D(banana=100) </s> remove         self.assertRaises(ValueError, City.objects.get, point__exact=htown.point)
 </s> add         with self.assertRaises(ValueError):
            City.objects.get(point__exact=htown.point) </s> remove             self.assertRaises(TypeError, fg1._set_ptr, bad_ptr)
            self.assertRaises(TypeError, fg2._set_ptr, bad_ptr)
 </s> add             with self.assertRaises(TypeError):
                fg1._set_ptr(bad_ptr)
            with self.assertRaises(TypeError):
                fg2._set_ptr(bad_ptr)
            with self.assertRaises(ValidationError):
                fld.clean(bad_default)
      def test_init(self):
          "Testing GeometryField initialization with defaults."
          fld = forms.GeometryField()
          for bad_default in ('blah', 3, 'FoO', None, 0):
            with self.assertRaises(ValidationError):
                fld.clean(bad_default)
  
      def test_srid(self):
          "Testing GeometryField with a SRID set."
          # Input that doesn't specify the SRID is assumed to be in the SRID
          # of the input field.
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/test_geoforms.py