summaryrefslogtreecommitdiffstats
path: root/core/TESTS
diff options
context:
space:
mode:
Diffstat (limited to 'core/TESTS')
-rw-r--r--core/TESTS/test_caves.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/core/TESTS/test_caves.py b/core/TESTS/test_caves.py
index 2fb3102..10dd9db 100644
--- a/core/TESTS/test_caves.py
+++ b/core/TESTS/test_caves.py
@@ -8,6 +8,8 @@ from http import HTTPStatus
from django.test import Client, TestCase
from django.contrib.auth.models import User
+import settings
+
from troggle.core.models.caves import Cave
from troggle.core.models.troggle import Person, PersonExpedition, Expedition
from troggle.core.utils import current_expo
@@ -24,6 +26,11 @@ def create_user(name=None, last_name="Caver", is_superuser=False):
u.save()
return u
+def create_cave(areacode="1623", kataster_number="000", official_name=""):
+ c = Cave(areacode=areacode, kataster_number=kataster_number, official_name=official_name)
+ c.save()
+ return c
+
# import troggle.settings as settings
# FIXTURE_DIRS = settings.PYTHON_PATH / "core" /"fixtures"
@@ -102,14 +109,10 @@ class FixtureTests(TestCase):
class FixturePageTests(TestCase):
- """Currently nothing that runs troggle works - all do 404. Must be something in a template rendering crash?
- ordinary pages are OK, and expopages and expofiles are OK, even though they come through troggle. And the
- fixtures are certainly loaded into the db as the other tests show.
+ """The fixtures have a password hash which is compatible with plain-text password 'secretword'
+ The hash CHANGES whenever Django upgrades the encryption key length. Better to create the test uses
+ algorithmically and not via a fixture.
"""
-
- # The fixtures have a password hash which is compatible with plain-text password 'secretword'
- # The hash CHANGES whenever Django upgrades the encryption key length. Better to create the test uses
- # algorithmically and not via a fixture.
fixtures = ["expo_caves", "expo_exped"]
ph = r"and leads in 800m of tortuous going to"
@@ -118,6 +121,11 @@ class FixturePageTests(TestCase):
pass
def setUp(self):
+ for kataster_number in settings.NOTABLECAVES1623:
+ create_cave(areacode="1623", kataster_number=kataster_number)
+ for kataster_number in settings.NOTABLECAVES1626:
+ create_cave(areacode="1626", kataster_number=kataster_number)
+
create_user(name="expo")
create_user(name="expotest")
create_user(name="expotestadmin", is_superuser = True)
@@ -129,6 +137,7 @@ class FixturePageTests(TestCase):
def tearDown(self):
User.objects.all().delete()
+ Cave.objects.all().delete()
def test_fix_expedition(self):
response = self.client.get("/expedition/2019")