mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-22 07:11:52 +00:00
new test for lbe
This commit is contained in:
parent
98bc6007a5
commit
5a7eda0968
@ -66,6 +66,7 @@ class ImportTest(TestCase):
|
|||||||
# NOT created Kurt, as the whole point is that he is a guest.
|
# NOT created Kurt, as the whole point is that he is a guest.
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
lbp.LoadLogbook(self.test_expo)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
@ -76,8 +77,6 @@ class ImportTest(TestCase):
|
|||||||
|
|
||||||
def test_logbook_parse(self):
|
def test_logbook_parse(self):
|
||||||
|
|
||||||
lbp.LoadLogbook(self.test_expo)
|
|
||||||
|
|
||||||
issues = DataIssue.objects.all()
|
issues = DataIssue.objects.all()
|
||||||
messages = []
|
messages = []
|
||||||
for i in issues:
|
for i in issues:
|
||||||
@ -87,7 +86,7 @@ class ImportTest(TestCase):
|
|||||||
print(f"'{i.message}'")
|
print(f"'{i.message}'")
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
" ! - 1986 No name match for: 'Kurt Keinnamen' in entry tid='1986-07-27c' for this year.",
|
"! - 1986 No name match for: 'Kurt Keinnamen' in entry",
|
||||||
]
|
]
|
||||||
|
|
||||||
not_expected = [
|
not_expected = [
|
||||||
@ -103,6 +102,18 @@ class ImportTest(TestCase):
|
|||||||
for e in not_expected:
|
for e in not_expected:
|
||||||
self.assertNotIn(e, messages)
|
self.assertNotIn(e, messages)
|
||||||
|
|
||||||
|
def test_lbe(self):
|
||||||
|
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 + "'")
|
||||||
|
|
||||||
def test_aliases(self):
|
def test_aliases(self):
|
||||||
# Problem: '' empty string appears as valid alias for David Smartarse
|
# Problem: '' empty string appears as valid alias for David Smartarse
|
||||||
response = self.client.get(f"/aliases/{TEST_YEAR}")
|
response = self.client.get(f"/aliases/{TEST_YEAR}")
|
||||||
|
Loading…
Reference in New Issue
Block a user