summaryrefslogtreecommitdiffstats
path: root/core/TESTS
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-01 21:50:03 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-01 21:50:03 +0300
commit34064972e9836ba855fe6e4585745bd2ce7a4c62 (patch)
treee2a86463629f1ca46ab732d6a3f67daca74768b4 /core/TESTS
parent5a7eda09689cadca8091305e858df244992c131c (diff)
downloadtroggle-34064972e9836ba855fe6e4585745bd2ce7a4c62.tar.gz
troggle-34064972e9836ba855fe6e4585745bd2ce7a4c62.tar.bz2
troggle-34064972e9836ba855fe6e4585745bd2ce7a4c62.zip
Still one test failing when it shouldnt
Diffstat (limited to 'core/TESTS')
-rw-r--r--core/TESTS/test_parsers.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/core/TESTS/test_parsers.py b/core/TESTS/test_parsers.py
index 450cf97..9a77080 100644
--- a/core/TESTS/test_parsers.py
+++ b/core/TESTS/test_parsers.py
@@ -65,8 +65,7 @@ class ImportTest(TestCase):
mike = make_person("Michael", "Wideboy", "WB", vfho=True)
# NOT created Kurt, as the whole point is that he is a guest.
- def setUp(self):
- lbp.LoadLogbook(self.test_expo)
+ def setUp(self):
pass
def tearDown(self):
@@ -76,6 +75,7 @@ class ImportTest(TestCase):
self.assertTrue(self.test_logbook.is_file())
def test_logbook_parse(self):
+ lbp.LoadLogbook(self.test_expo)
issues = DataIssue.objects.all()
messages = []
@@ -103,16 +103,20 @@ class ImportTest(TestCase):
self.assertNotIn(e, messages)
def test_lbe(self):
- lbp.LoadLogbook(self.test_expo)
+ lbp.LoadLogbook(self.test_expo)
response = self.client.get(f"/logbookentry/1986-07-27/1986-07-27b")
self.assertEqual(response.status_code, HTTPStatus.OK)
content = response.content.decode()
with open('_test_response.html', 'w') as f:
f.write(content)
- ph = "Smartarse rig first section of new pitches. Second wave arrives and takes over rigging."
- phmatch = re.search(ph, content)
- self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
+ expected = [
+ "Logbook CUCC expo-test 1986 123 - 123 Wave 1",
+ "Smartarse rig first section of new pitches. Second wave arrives and takes over rigging.",
+ ]
+ for ph in expected:
+ phmatch = re.search(ph, content)
+ self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
def test_aliases(self):
# Problem: '' empty string appears as valid alias for David Smartarse
@@ -135,7 +139,6 @@ class ImportTest(TestCase):
ph = f"Caves with subdirectories"
phmatch = re.search(ph, content)
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
-
def test_people(self):
# Needs another test with test data