diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-09-08 17:49:05 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:18 +0100 |
commit | f115f144dc01a41c1373485416488b77ecaa62fc (patch) | |
tree | 95fc53fcdc8959da12250e0a4f49b35e0af902d3 /archaeological_finds/tests.py | |
parent | 392a3508b2a5bfe266844b5be4ab58a01caff766 (diff) | |
download | Ishtar-f115f144dc01a41c1373485416488b77ecaa62fc.tar.bz2 Ishtar-f115f144dc01a41c1373485416488b77ecaa62fc.zip |
Geo display: clean old code - manage bad data
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 3fd7d56e2..16e4b3304 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -95,7 +95,6 @@ from ishtar_common.tests import ( COMMON_FIXTURES, GenericSerializationTest, SearchText, - SeleniumTests, ) from archaeological_operations.tests import ImportTest, create_operation from archaeological_context_records.tests import ContextRecordInit @@ -2904,85 +2903,3 @@ class TemplateTest(FindInit, TestCase): os.remove(tpl) -@tag("ui") -class SeleniumTestsBaseFinds(SeleniumTests): - fixtures = FIND_FIXTURES - - def _test_bf(self, xpath, slug_pk, geojsons): - self.wait_and_click(xpath) - label = self.label_from_internal_id(slug_pk) - - bf_base = geojsons[label]["get_polys"] - self.assertMap(bf_base, slug_pk) - - title = '//dl[@class="col-12"]/dt[text()="Display geo items" or text()="Afficher les éléments"]' - dd = '//dl[@class="col-12"]/dd' - disp = dd + '/input[@name="checkbox-geo-items"]' - get_poly = dd + '/select[@name="get-poly-geo-items"]' - self.assertNotInDOM(title) - self.assertNotInDOM(disp) - self.assertNotInDOM(get_poly) - - def test_geo_items(self): - if not settings.SELENIUM_TEST: - return - geojsons = self.default_geojson() - # from operation - self.access_from_dropdown("operation") - for ope_pk, ope_xpath in self.pks_and_details_from_table("operation"): - self.access_from_dropdown("operation") - self.wait_and_click(ope_xpath) - self.selenium.find_element_by_xpath( - '//ul[@role="tablist"]/li/a[contains(@id, "finds-tab")][contains(@id, "operation-' - + str(ope_pk) - + '")]' - ).click() - for pk, xpath in self.pks_and_details_from_table("find", "operation"): - slug_pk = "find-" + str(pk) - self._test_bf(xpath, slug_pk, copy.deepcopy(geojsons)) - # from context record - self.access_from_dropdown("record") - for cr_pk, cr_xpath in self.pks_and_details_from_table("record"): - self.access_from_dropdown("record") - self.wait_and_click(cr_xpath) - self.selenium.find_element_by_xpath( - '//ul[@role="tablist"]/li/a[contains(@id, "finds-tab")][contains(@id, "contextrecord-' - + str(cr_pk) - + '")]' - ).click() - for pk, xpath in self.pks_and_details_from_table("find", "record"): - slug_pk = "find-" + str(pk) - self._test_bf(xpath, slug_pk, copy.deepcopy(geojsons)) - # from context record from operation - self.access_from_dropdown("operation") - for ope_pk, ope_xpath in self.pks_and_details_from_table("operation"): - self.access_from_dropdown("operation") - self.wait_and_click(ope_xpath) - self.selenium.find_element_by_xpath( - '//ul[@role="tablist"]/li/a[contains(@id, "cr-tab")][contains(@id, "operation-' - + str(ope_pk) - + '")]' - ).click() - for cr_pk, cr_xpath in self.pks_and_details_from_table( - "record", "operation" - ): - self.wait_and_click(cr_xpath) - self.selenium.find_element_by_xpath( - '//ul[@role="tablist"]/li/a[contains(@id, "finds-tab")][contains(@id, "contextrecord-' - + str(cr_pk) - + '")]' - ).click() - for pk, xpath in self.pks_and_details_from_table("find", "record"): - slug_pk = "find-" + str(pk) - self._test_bf(xpath, slug_pk, copy.deepcopy(geojsons)) - # from search bar - self.access_from_dropdown("find") - from_table = self.pks_and_details_from_table("find") - for pk, xpath in from_table: - self.access_from_dropdown("find") - slug_pk = "find-" + str(pk) - self._test_bf(xpath, slug_pk, copy.deepcopy(geojsons)) - # from bottom table, multiple displays - for pk, xpath in from_table: - slug_pk = "find-" + str(pk) - self._test_bf(xpath, slug_pk, copy.deepcopy(geojsons)) |