def test27_valid_reason(self):
        # Skipping tests if GEOS < v3.1.
        if not GEOS_PREPARE: return

        g = GEOSGeometry("POINT(0 0)")
        self.assertTrue(g.valid)
        self.assertTrue(isinstance(g.valid_reason, basestring))
        self.assertEqual(g.valid_reason, "Valid Geometry")

        print "\nBEGIN - expecting GEOS_NOTICE; safe to ignore.\n"

        g = GEOSGeometry("LINESTRING(0 0, 0 0)")

        self.assertTrue(not g.valid)
        self.assertTrue(isinstance(g.valid_reason, basestring))
        self.assertTrue(g.valid_reason.startswith("Too few points in geometry component"))

        print "\nEND - expecting GEOS_NOTICE; safe to ignore.\n"
Testing IsValidReason support
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/gis/geos/tests/test_geos.py/GEOSTest.test27_valid_reason