def setUp(self): # noqa BaseTestCase.setUp(self) self.user1 = self.session.query(User).get( self.global_userids['contributor']) self.user2 = self.session.query(User).get( self.global_userids['contributor2']) self.waypoint = Waypoint(waypoint_type='summit') self.session.add(self.waypoint) self.area1 = Area(area_type='range') self.area2 = Area(area_type='range') self.session.add_all([self.waypoint, self.area1, self.area2]) self.session.flush()
def setUp(self): # noqa BaseTestCase.setUp(self) self.map1 = TopoMap( code='3232ET', geometry=DocumentGeometry( geom_detail='SRID=3857;POLYGON((668518.249382151 5728802.39591739,668518.249382151 5745465.66808356,689156.247019149 5745465.66808356,689156.247019149 5728802.39591739,668518.249382151 5728802.39591739))') # noqa ) self.session.add(self.map1) self.session.flush() self.map2 = TopoMap( code='3233ET', redirects_to=self.map1.document_id, geometry=DocumentGeometry( geom_detail='SRID=3857;POLYGON((668518.249382151 5728802.39591739,668518.249382151 5745465.66808356,689156.247019149 5745465.66808356,689156.247019149 5728802.39591739,668518.249382151 5728802.39591739))') # noqa ) # wp inside the area of the map self.waypoint1 = Waypoint( waypoint_type='summit', geometry=DocumentGeometry( geom='SRID=3857;POINT(677461.381691516 5740879.44638645)') ) # wp outside the area of the map self.waypoint2 = Waypoint( waypoint_type='summit', geometry=DocumentGeometry( geom='SRID=3857;POINT(693666.031687976 5741108.7574713)') ) # wp without geometry self.waypoint3 = Waypoint( waypoint_type='summit' ) # wp with empty geometry self.waypoint4 = Waypoint( waypoint_type='summit', geometry=DocumentGeometry() ) self.session.add_all([ self.map2, self.waypoint1, self.waypoint2, self.waypoint3, self.waypoint4]) self.session.flush() # wp inside the area of the map, but with `redirects_to` # (should be ignored) self.waypoint5 = Waypoint( waypoint_type='summit', redirects_to=self.waypoint1.document_id, geometry=DocumentGeometry( geom='SRID=3857;POINT(677461.381691516 5740879.44638645)') ) self.session.add(self.waypoint5)
def setUp(self): # noqa BaseTestCase.setUp(self) self.waypoint1 = Waypoint(waypoint_type='summit') self.waypoint2 = Waypoint(waypoint_type='summit') self.route1 = Route(activities=['hiking']) self.route2 = Route(activities=['hiking']) self.user_profile1 = UserProfile() self.user_profile2 = UserProfile() self.session.add_all([ self.waypoint1, self.waypoint2, self.route1, self.route2, self.user_profile1, self.user_profile2]) self.session.flush()
def setUp(self): # noqa BaseTestCase.setUp(self) self.waypoint1 = Waypoint(waypoint_type='summit') self.waypoint2 = Waypoint(waypoint_type='summit') self.route1 = Route(activities=['hiking']) self.route2 = Route(activities=['hiking']) self.user_profile1 = UserProfile() self.user_profile2 = UserProfile() self.session.add_all([ self.waypoint1, self.waypoint2, self.route1, self.route2, self.user_profile1, self.user_profile2 ]) self.session.flush()
def setUp(self): # noqa BaseTestCase.setUp(self) self.area1 = Area( area_type='range', geometry=DocumentGeometry( geom_detail= 'SRID=3857;POLYGON((668518.249382151 5728802.39591739,668518.249382151 5745465.66808356,689156.247019149 5745465.66808356,689156.247019149 5728802.39591739,668518.249382151 5728802.39591739))' ) # noqa ) self.session.add(self.area1) self.session.flush() self.area2 = Area( area_type='range', redirects_to=self.area1.document_id, geometry=DocumentGeometry( geom_detail= 'SRID=3857;POLYGON((668518.249382151 5728802.39591739,668518.249382151 5745465.66808356,689156.247019149 5745465.66808356,689156.247019149 5728802.39591739,668518.249382151 5728802.39591739))' ) # noqa ) # wp inside the area self.waypoint1 = Waypoint( waypoint_type='summit', geometry=DocumentGeometry( geom='SRID=3857;POINT(677461.381691516 5740879.44638645)')) # wp outside the area self.waypoint2 = Waypoint( waypoint_type='summit', geometry=DocumentGeometry( geom='SRID=3857;POINT(693666.031687976 5741108.7574713)')) # wp without geometry self.waypoint3 = Waypoint(waypoint_type='summit') # wp with empty geometry self.waypoint4 = Waypoint(waypoint_type='summit', geometry=DocumentGeometry()) self.session.add_all([ self.area2, self.waypoint1, self.waypoint2, self.waypoint3, self.waypoint4 ]) self.session.flush() # wp inside the area, but with `redirects_to` (should be ignored) self.waypoint5 = Waypoint( waypoint_type='summit', redirects_to=self.waypoint1.document_id, geometry=DocumentGeometry( geom='SRID=3857;POINT(677461.381691516 5740879.44638645)')) self.session.add(self.waypoint5)
def setUp(self): # noqa BaseTestCase.setUp(self)
def setUp(self): # noqa BaseTestCase.setUp(self) self._add_test_data()