mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-17 14:57:13 +00:00
fix pointless error messages in tests
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user