From 2f6017d6d3e8b447895dbf3c9c2fe8d39ca4ecc4 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 10 Sep 2023 15:55:01 +0300 Subject: [PATCH] testsuite passes - Area removed --- core/TESTS/test_caves.py | 11 +++----- core/TESTS/test_imports.py | 2 +- core/fixtures/expo_areas.json | 52 ----------------------------------- core/fixtures/expo_caves.json | 4 +-- 4 files changed, 7 insertions(+), 62 deletions(-) delete mode 100644 core/fixtures/expo_areas.json diff --git a/core/TESTS/test_caves.py b/core/TESTS/test_caves.py index c0a2e9c..42b0924 100644 --- a/core/TESTS/test_caves.py +++ b/core/TESTS/test_caves.py @@ -7,7 +7,7 @@ from http import HTTPStatus from django.test import Client, TestCase -from troggle.core.models.caves import Area, Cave +from troggle.core.models.caves import Cave from troggle.core.models.troggle import Person, PersonExpedition # import troggle.settings as settings @@ -18,7 +18,7 @@ class FixtureTests(TestCase): They do not exercise the GET and url functions """ - fixtures = ["auth_users", "expo_areas", "expo_caves", "expo_exped"] + fixtures = ["auth_users", "expo_caves", "expo_exped"] ph = r"and leads in 800m of tortuous going to" def setUp(self): @@ -36,15 +36,12 @@ class FixtureTests(TestCase): self.assertEqual(str(pe.person.fullname), "Michael Sargent") self.assertEqual(str(pe.expedition.year), "2019") - def test_fix_area_loaded(self): - a = Area.objects.get(short_name="1623") - self.assertEqual(str(a.short_name), "1623") - def test_fix_cave_loaded115(self): c = Cave.objects.get(kataster_number="115") self.assertEqual(str(c.description_file), "1623/115.htm") self.assertEqual(str(c.url), "1623/115.url") # intentional self.assertEqual(str(c.filename), "1623-115.html") + self.assertEqual(str(c.areacode), "1623") # c.area is a 'ManyRelatedManager' object and not iterable # self.assertEqual(str(c.[0].short_name), "1623") @@ -82,7 +79,7 @@ class FixturePageTests(TestCase): """ # The fixtures have a password hash which is compatible with plain-text password 'secretword' - fixtures = ["auth_users", "expo_areas", "expo_caves", "expo_exped"] + fixtures = ["auth_users", "expo_caves", "expo_exped"] ph = r"and leads in 800m of tortuous going to" @classmethod diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py index 21601fb..56a5e71 100644 --- a/core/TESTS/test_imports.py +++ b/core/TESTS/test_imports.py @@ -84,7 +84,7 @@ class SimpleTest(SimpleTestCase): import troggle.core.views.expo from troggle.core.forms import CaveAndEntranceFormSet, CaveForm, EntranceForm, EntranceLetterForm - from troggle.core.models.caves import Area, Cave, CaveAndEntrance, Entrance, SurvexStation #EntranceSlug, + from troggle.core.models.caves import Cave, CaveAndEntrance, Entrance, SurvexStation #EntranceSlug, from troggle.core.models.troggle import Expedition from troggle.core.views.auth import login_required_if_public diff --git a/core/fixtures/expo_areas.json b/core/fixtures/expo_areas.json deleted file mode 100644 index 701e64b..0000000 --- a/core/fixtures/expo_areas.json +++ /dev/null @@ -1,52 +0,0 @@ -[ -{"model": "core.area", "pk": 25, "fields": - {"short_name": "1626 or 6 (borderline)", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 24, "fields": - {"short_name": "8a", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 23, "fields": - {"short_name": "2b or 4 (unclear)", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 22, "fields": - {"short_name": "11", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 21, "fields": - {"short_name": "3", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 20, "fields": - {"short_name": "4", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 19, "fields": - {"short_name": "1b", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 18, "fields": - {"short_name": "8b", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 17, "fields": - {"short_name": "2d", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 16, "fields": - {"short_name": "7", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 15, "fields": - {"short_name": "2b", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 14, "fields": - {"short_name": "8c", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 13, "fields": - {"short_name": "2c", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 12, "fields": - {"short_name": "8d", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 11, "fields": - {"short_name": "", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 10, "fields": - {"short_name": "5", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 9, "fields": - {"short_name": "6", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 8, "fields": - {"short_name": "2a", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 7, "fields": - {"short_name": "1c", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 6, "fields": - {"short_name": "1d", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 5, "fields": - {"short_name": "1a", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 4, "fields": - {"short_name": "9", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 3, "fields": - {"short_name": "10", "name": null, "description": null, "super": 1, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 2, "fields": - {"short_name": "1626", "name": null, "description": null, "super": null, "new_since_parsing": false, "non_public": false}}, -{"model": "core.area", "pk": 1, "fields": - {"short_name": "1623", "name": null, "description": null, "super": null, "new_since_parsing": false, "non_public": false}} -] \ No newline at end of file diff --git a/core/fixtures/expo_caves.json b/core/fixtures/expo_caves.json index d2728f7..eec8600 100644 --- a/core/fixtures/expo_caves.json +++ b/core/fixtures/expo_caves.json @@ -16,7 +16,7 @@ "description_file": "1623/115.htm", "url": "1623/115.url", "filename": "1623-115.html", - "area": [1, 8]}}, + "areacode": "1623"}}, {"model": "core.cave", "pk": 350, "fields": {"new_since_parsing": false, "non_public": false, @@ -36,5 +36,5 @@ "description_file": "", "url": "1623/284/284.html", "filename": "1623-284.html", - "area": [1, 11]}} + "areacode": "1623"}} ] \ No newline at end of file