'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)'):
        self.assertEqual(GEOSGeometry(wkt), fld.clean(wkt))
    pnt_fld = forms.GeometryField(geom_type='POINT')
    self.assertEqual(GEOSGeometry('POINT(5    23)'), pnt_fld.clean('POINT(5    23)'))
    self.assertEqual(GEOSGeometry('LINESTRING(0    0,    1    1)'), pnt_fld.to_python('LINESTRING(0    0,    1    1)'))
    self.assertRaises(forms.ValidationError, pnt_fld.clean, 'LINESTRING(0    0,    1    1)')
