def test02_null(self):
        # Form fields, by default, are required (`required=True`)
        fld = forms.GeometryField()
        self.assertRaises(forms.ValidationError, fld.clean, None)

        # Still not allowed if `null=False`.
        fld = forms.GeometryField(required=False, null=False)
        self.assertRaises(forms.ValidationError, fld.clean, None)

        # This will clean None as a geometry (See #10660).
        fld = forms.GeometryField(required=False)
        self.assertEqual(None, fld.clean(None))
Testing GeometryField's handling of null (None) geometries.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/test_geoforms.py/GeometryFieldTest.test02_null