def _build_object(self): polygon = 'SRID=%s;MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0)))' % settings.SRID self.city = zoning_factories.CityFactory(geom=polygon) self.district = zoning_factories.DistrictFactory(geom=polygon) self.portal = common_factories.TargetPortalFactory() self.theme = common_factories.ThemeFactory() self.content = self.factory(geom='SRID=%s;POINT(1 1)' % settings.SRID, portals=[self.portal], themes=[self.theme]) self.picture = common_factories.AttachmentFactory( content_object=self.content, attachment_file=get_dummy_uploaded_image()) self.document = common_factories.AttachmentFactory( content_object=self.content, attachment_file=get_dummy_uploaded_document()) self.content.themes.add(self.theme) self.source = common_factories.RecordSourceFactory() self.content.source.add(self.source) self.content.portal.add(self.portal) if settings.TREKKING_TOPOLOGY_ENABLED: path = core_factories.PathFactory( geom='SRID=%s;LINESTRING(0 10, 10 10)' % settings.SRID) self.trek = trekking_factories.TrekFactory(paths=[path]) self.poi = trekking_factories.POIFactory(paths=[(path, 0.5, 0.5)]) else: self.trek = trekking_factories.TrekFactory( geom='SRID=%s;LINESTRING(0 10, 10 10)' % settings.SRID) self.poi = trekking_factories.POIFactory( geom='SRID=%s;POINT(0 5)' % settings.SRID)
def _build_object(self): polygon = 'SRID=%s;MULTIPOLYGON(((0 0, 0 3, 3 3, 3 0, 0 0)))' % settings.SRID self.city = zoning_factories.CityFactory(geom=polygon) self.district = zoning_factories.DistrictFactory(geom=polygon) self.content = self.factory(geom='SRID=%s;POINT(1 1)' % settings.SRID) self.picture = common_factories.AttachmentFactory( content_object=self.content, attachment_file=get_dummy_uploaded_image()) self.document = common_factories.AttachmentFactory( content_object=self.content, attachment_file=get_dummy_uploaded_document()) self.video = common_factories.AttachmentFactory( content_object=self.content, attachment_file='', attachment_video= 'http://www.youtube.com/embed/Jm3anSjly0Y?wmode=opaque') self.video_detected = detect_backend(self.video.attachment_video) self.theme = common_factories.ThemeFactory() self.content.themes.add(self.theme) self.source = common_factories.RecordSourceFactory() self.content.source.add(self.source) self.portal = common_factories.TargetPortalFactory() self.content.portal.add(self.portal) path = core_factories.PathFactory( geom='SRID=%s;LINESTRING(0 10, 10 10)' % settings.SRID) self.trek = trekking_factories.TrekFactory(no_path=True) self.trek.add_path(path) self.poi = trekking_factories.POIFactory(no_path=True) self.poi.add_path(path, start=0.5, end=0.5)
def setUp(self): self.content = tourism_factories.TouristicContentFactory(geom='SRID=%s;POINT(1 1)' % settings.SRID) self.content2 = tourism_factories.TouristicContentFactory(geom='SRID=%s;POINT(2 2)' % settings.SRID, name="ZZZ") self.event = tourism_factories.TouristicEventFactory(geom='SRID=%s;POINT(50 50)' % settings.SRID) self.event2 = tourism_factories.TouristicEventFactory(geom='SRID=%s;POINT(60 60)' % settings.SRID, name="ZZZ") if settings.TREKKING_TOPOLOGY_ENABLED: path = core_factories.PathFactory(geom='SRID=%s;LINESTRING(0 100, 100 100)' % settings.SRID) self.trek = trekking_factories.TrekFactory(paths=[path]) self.poi = trekking_factories.POIFactory(paths=[(path, 0.5, 0.5)]) else: self.trek = trekking_factories.TrekFactory(geom='SRID=%s;LINESTRING(0 100, 100 100)' % settings.SRID) self.poi = trekking_factories.POIFactory(geom='SRID=%s;POINT(50 100)' % settings.SRID)
def setUp(self): self.content = tourism_factories.TouristicContentFactory( geom='SRID=%s;POINT(1 1)' % settings.SRID) self.content2 = tourism_factories.TouristicContentFactory( geom='SRID=%s;POINT(2 2)' % settings.SRID) self.event = tourism_factories.TouristicEventFactory( geom='SRID=%s;POINT(50 50)' % settings.SRID) self.event2 = tourism_factories.TouristicEventFactory( geom='SRID=%s;POINT(60 60)' % settings.SRID) path = core_factories.PathFactory( geom='SRID=%s;LINESTRING(0 100, 100 100)' % settings.SRID) self.trek = trekking_factories.TrekFactory(no_path=True) self.trek.add_path(path) self.poi = trekking_factories.POIFactory(no_path=True) self.poi.add_path(path, start=0.5, end=0.5)