'Testing GeometryField\'s handling of different geometry types.'

def test_geom_type(self):

    fld = forms.GeometryField()
    for wkt in ('POINT(5    23)', 'MULTIPOLYGON(((0    0,    0    1,    1    1,    1    0,    0    0)))', 'LINESTRING(0    0,    1    1)'):
        with self.subTest(wkt=wkt):
            self.assertEqual(GEOSGeometry(wkt, srid=fld.widget.map_srid), fld.clean(wkt))
    pnt_fld = forms.GeometryField(geom_type='POINT')
    self.assertEqual(GEOSGeometry('POINT(5    23)', srid=pnt_fld.widget.map_srid), pnt_fld.clean('POINT(5    23)'))
    self.assertEqual(GEOSGeometry('LINESTRING(0    0,    1    1)', srid=pnt_fld.widget.map_srid), pnt_fld.to_python('LINESTRING(0    0,    1    1)'))
    with self.assertRaises(forms.ValidationError):
        pnt_fld.clean('LINESTRING(0    0,    1    1)')
