<s> from __future__ import unicode_literals <EOL> from django . contrib . gis . geos import ( <EOL> GeometryCollection , LineString , MultiLineString , MultiPoint , MultiPolygon , <EOL> Point , Polygon , <EOL> ) <EOL> from django . db import connection <EOL> from django . test . utils import skipUnless <EOL> from django . utils . module_loading import import_string <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from mutant . models import BaseDefinition <EOL> from mutant . test . testcases import FieldDefinitionTestMixin <EOL> from . utils import BaseModelDefinitionTestCase <EOL> class GeometryFieldDefinitionTestMixin ( FieldDefinitionTestMixin ) : <EOL> field_definition_category = _ ( '<STR_LIT>' ) <EOL> @ property <EOL> def field_definition_cls ( self ) : <EOL> return import_string ( "<STR_LIT>" % self . field_definition_cls_name ) <EOL> def setUp ( self ) : <EOL> super ( GeometryFieldDefinitionTestMixin , self ) . setUp ( ) <EOL> from mutant . contrib . geo . models import GeoModel <EOL> BaseDefinition . objects . create ( model_def = self . model_def , base = GeoModel ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class GeometryFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> LineString ( ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:3> , <NUM_LIT:4> ) , ( <NUM_LIT:5> , <NUM_LIT:6> ) , ( <NUM_LIT:7> , <NUM_LIT:8> ) , ( <NUM_LIT:9> , <NUM_LIT:10> ) ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class PointFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( Point ( <NUM_LIT:5> , <NUM_LIT> ) , Point ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class LineStringFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> LineString ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) , <EOL> LineString ( ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:3> , <NUM_LIT:4> ) , ( <NUM_LIT:5> , <NUM_LIT:6> ) , ( <NUM_LIT:7> , <NUM_LIT:8> ) , ( <NUM_LIT:9> , <NUM_LIT:10> ) ) <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class PolygonFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class MultiLineStringFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> MultiLineString ( <EOL> LineString ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) , <EOL> LineString ( ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:3> , <NUM_LIT:4> ) , ( <NUM_LIT:5> , <NUM_LIT:6> ) , ( <NUM_LIT:7> , <NUM_LIT:8> ) , ( <NUM_LIT:9> , <NUM_LIT:10> ) ) , <EOL> ) , <EOL> MultiLineString ( <EOL> LineString ( ( <NUM_LIT> , <NUM_LIT:7> ) , ( <NUM_LIT> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0> ) ) , <EOL> LineString ( ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:3> , <NUM_LIT:4> ) , ( <NUM_LIT:5> , <NUM_LIT:6> ) , ( <NUM_LIT:7> , <NUM_LIT:8> ) , ( <NUM_LIT:9> , <NUM_LIT:10> ) ) , <EOL> LineString ( ( <NUM_LIT:0> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:50> ) , ( <NUM_LIT:50> , <NUM_LIT:0> ) , ( <NUM_LIT:0> , <NUM_LIT:0> ) ) , <EOL> ) , <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class MultiPointFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> MultiPoint ( Point ( <NUM_LIT:0> , <NUM_LIT:0> ) , Point ( <NUM_LIT:1> , <NUM_LIT:1> ) ) , <EOL> MultiPoint ( Point ( <NUM_LIT:5> , <NUM_LIT> ) , Point ( <NUM_LIT> , <NUM_LIT> ) , Point ( <NUM_LIT> , <NUM_LIT> ) ) , <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class MultiPolygonFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> MultiPolygon ( <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> ) , <EOL> MultiPolygon ( <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> ) , <EOL> ) <EOL> @ skipUnless ( connection . settings_dict [ '<STR_LIT>' ] == '<STR_LIT>' , '<STR_LIT>' ) <EOL> class GeometryCollectionFieldDefinitionTest ( GeometryFieldDefinitionTestMixin , <EOL> BaseModelDefinitionTestCase ) : <EOL> field_definition_cls_name = '<STR_LIT>' <EOL> field_values = ( <EOL> GeometryCollection ( <EOL> Point ( <NUM_LIT:0> , <NUM_LIT:0> ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> ) , <EOL> GeometryCollection ( <EOL> LineString ( ( <NUM_LIT:1> , <NUM_LIT:2> ) , ( <NUM_LIT:3> , <NUM_LIT:4> ) , ( <NUM_LIT:5> , <NUM_LIT:6> ) , ( <NUM_LIT:7> , <NUM_LIT:8> ) , ( <NUM_LIT:9> , <NUM_LIT:10> ) ) , <EOL> Polygon ( <EOL> ( ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT> ) , ( <NUM_LIT> , <NUM_LIT:0.0> ) , ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) <EOL> ) , <EOL> Point ( <NUM_LIT:5> , <NUM_LIT> ) , <EOL> Point ( <NUM_LIT> , <NUM_LIT> ) , <EOL> ) , <EOL> ) </s>
