diff options
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/tests.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 9d1c0c0ea..bbcf1ddd5 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -4371,48 +4371,3 @@ class SeleniumTestsOperations(SeleniumTests): self.selenium.find_element_by_xpath('//div[@class="dropdown-menu show"]/a[@href="/operation_search/"]').click() self._test_operation(2, dic_pt, geo_elements[1], geo_elements[2]) # point based operation - def assertPt(self, item, geom): - self.assertEqual(item.multi_polygon.coords, geom[0].coords) - self.assertEqual(item.point_2d.coords, geom[2].coords) - - def assertPoly(self, item, geom, real_point=None): - self.assertEqual(item.multi_polygon.coords, geom[0].coords) - if real_point: - self.assertEqual((round(item.x, 5), round(item.y, 5)), real_point.coords) - else: - self.assertEqual((round(item.x, 5), round(item.y, 5)), geom[1].coords) - - def test_setUpDefaultItems(self): - from django.contrib.gis.geos import GEOSGeometry - from archaeological_operations.models import Operation - base_geoms, pks = self.setUpDefaultGeoItems() - geoms = [] - for geom in base_geoms: - poly = GEOSGeometry(json.dumps({'type': 'MultiPolygon', 'coordinates': geom[0]})) - centr = GEOSGeometry(json.dumps({'type': 'Point', 'coordinates': geom[1]})) - pt = GEOSGeometry(json.dumps({'type': 'Point', 'coordinates': geom[2]})) - geoms.append([poly, centr, pt]) - ope_pt = Operation.objects.get(pk=pks['Pt']) - self.assertPt(ope_pt, geoms[0]) - ope_poly = Operation.objects.get(pk=pks['Poly']) - self.assertPoly(ope_poly, geoms[0]) - - cr_poly_poly = ope_poly.context_record.get(pk=pks['CR Poly Poly']) - self.assertPoly(cr_poly_poly, geoms[1]) - cr_poly_pt = ope_poly.context_record.get(pk=pks['CR Poly Pt']) - self.assertPt(cr_poly_pt, geoms[1]) - cr_pt_poly = ope_pt.context_record.get(pk=pks['CR Pt Poly']) - self.assertPoly(cr_pt_poly, geoms[1], geoms[0][2]) - cr_pt_pt = ope_pt.context_record.get(pk=pks['CR Pt Pt']) - self.assertPt(cr_pt_pt, geoms[1]) - - self.assertPt(cr_pt_pt.base_finds.get(pk=pks['Find Point from CR Pt Pt']), geoms[2]) - self.assertPoly(cr_pt_pt.base_finds.get(pk=pks['Find Polygon from CR Pt Pt']), geoms[2], geoms[1][2]) - self.assertPt(cr_poly_pt.base_finds.get(pk=pks['Find Point from CR Poly Pt']), geoms[2]) - self.assertPoly(cr_poly_pt.base_finds.get(pk=pks['Find Polygon from CR Poly Pt']), geoms[2], geoms[1][2]) - self.assertPt(cr_pt_poly.base_finds.get(pk=pks['Find Point from CR Pt Poly']), geoms[2]) - self.assertPoly(cr_pt_poly.base_finds.get(pk=pks['Find Polygon from CR Pt Poly']), geoms[2], geoms[0][2]) - self.assertPt(cr_poly_poly.base_finds.get(pk=pks['Find Point from CR Poly Poly']), geoms[2]) - self.assertPoly(cr_poly_poly.base_finds.get(pk=pks['Find Polygon from CR Poly Poly']), geoms[2]) - - |