          self.assertEqual(a.sq_m, 258998811.0336)
  
      def testInitInvaliA(self):
          "Testing initialization from invalid units"
          self.assertRaises(AttributeError, A, banana=100)
  
      def testAccess(self):
          "Testing access in different units"
          a = A(sq_m=100)
          self.assertEqual(a.sq_km, 0.0001)
 
</s> remove         self.assertRaises(AttributeError, D, banana=100)
 </s> add         with self.assertRaises(AttributeError):
            D(banana=100) </s> remove             self.assertRaises(ValidationError, fld.clean, bad_default)
 </s> add             with self.assertRaises(ValidationError):
                fld.clean(bad_default) </s> remove             self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly')
 </s> add             with self.assertRaises(NotImplementedError):
                Country.objects.all().geojson(field_name='mpoly') </s> remove         self.assertRaises(TypeError, qs.kml, 'name')
 </s> add         with self.assertRaises(TypeError):
            qs.kml('name') </s> remove         self.assertRaises(GEOSException, g.relate_pattern, 0, 'invalid pattern, yo')
 </s> add         with self.assertRaises(GEOSException):
            g.relate_pattern(0, 'invalid pattern, yo')
        with self.assertRaises(AttributeError):
            A(banana=100)
          self.assertEqual(a.sq_m, 258998811.0336)
  
      def testInitInvaliA(self):
          "Testing initialization from invalid units"
        with self.assertRaises(AttributeError):
            A(banana=100)
  
      def testAccess(self):
          "Testing access in different units"
          a = A(sq_m=100)
          self.assertEqual(a.sq_km, 0.0001)
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/gis_tests/test_measure.py