From 1b70ccea3e782b171560e997499c19015e8b5980 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Mon, 16 Jan 2023 19:52:05 +0000 Subject: [PATCH] consistent tests with logbooks junk removal --- core/TESTS/test_imports.py | 2 +- core/TESTS/tests.py | 2 +- core/TESTS/tests_logins.py | 2 +- parsers/logbooks.py | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py index 238523a..943b5d9 100644 --- a/core/TESTS/test_imports.py +++ b/core/TESTS/test_imports.py @@ -100,7 +100,7 @@ class SimpleTest(SimpleTestCase): from troggle.core.views.caves import ent, cavepage from troggle.core.views.expo import expofiles_redirect, expofilessingle, expopage, editexpopage, mediapage, map, mapfile from troggle.core.views.logbooks import expedition, personexpedition, Expeditions_tsvListView, Expeditions_jsonListView - from troggle.core.views.logbooks import get_logbook_entries, logbookentry, logbookSearch + from troggle.core.views.logbooks import get_logbook_entries, logbookentry from troggle.core.views.logbooks import notablepersons, person, get_people from troggle.core.views.other import controlpanel from troggle.core.views.prospect import prospecting diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index fa539d9..e74a11b 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -204,7 +204,7 @@ class PageTests(TestCase): response = self.client.get('/admin/login/') content = response.content.decode() self.assertEqual(response.status_code, 200) - ph = r'

Troggle administration

' + ph = r'

Troggle database administration

' phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") diff --git a/core/TESTS/tests_logins.py b/core/TESTS/tests_logins.py index d69b394..364f16a 100644 --- a/core/TESTS/tests_logins.py +++ b/core/TESTS/tests_logins.py @@ -351,7 +351,7 @@ class ComplexLoginTests(TestCase): content = response.content.decode() # with open('admin-op.html', 'w') as f: # f.write(content) - t = re.search(r'Troggle administration', content) + t = re.search(r'Troggle database administration', content) self.assertIsNotNone(t, 'Logged in as \'' + u.username + '\' but failed to get the Troggle Admin page' ) def test_noinfo_login(self): diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 8501b89..a6d94f4 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -23,7 +23,7 @@ Parses and imports logbooks in all their wonderful confusion todo=''' - refactor everything with some urgency, esp. LoadLogbookForExpedition() -- remove the TROG and lbo things since we need the database for multiuser access? Or not? +- remove the TROG things since we need the database for multiuser access? Or not? - profile the code to find bad repetitive things, of which there are many. @@ -44,7 +44,7 @@ todo=''' - this is a slow and uncertain function: cave = getCaveByReference(caveRef) - use Fixtures https://docs.djangoproject.com/en/4.1/ref/django-admin/#django-admin-loaddata to cache -data for old logbooks. New design needed, with a mechanism for flagging fixtures as outdated after edits. +data for old logbooks? Not worth it.. ''' MAX_LOGBOOK_ENTRY_TITLE_LENGTH = 200 @@ -57,6 +57,7 @@ BLOG_PARSER_SETTINGS = { DEFAULT_LOGBOOK_FILE = "logbook.html" DEFAULT_LOGBOOK_PARSER = "parser_html" # All years since 2002 use the default value for Logbook parser +# dont forget to update expoweb/pubs.htm to match. LOGBOOK_PARSER_SETTINGS = { "2002": ("logbook.html", "parser_html"), "2001": ("log.htm", "parser_html_01"),