mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-04-04 01:41:44 +01:00
fix code so tests work
This commit is contained in:
parent
9db0b2a191
commit
81b5198cd1
@ -173,6 +173,8 @@ class PageTests(TestCase):
|
|||||||
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
|
self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph + "'")
|
||||||
|
|
||||||
def test_caves_page(self):
|
def test_caves_page(self):
|
||||||
|
# Throws up lots of cave error msgs because it is looking at something which is not loaded for the tests
|
||||||
|
# but the test itself does not fail
|
||||||
response = self.client.get("/caves")
|
response = self.client.get("/caves")
|
||||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||||
content = response.content.decode()
|
content = response.content.decode()
|
||||||
|
@ -114,10 +114,14 @@ def getnotablecaves():
|
|||||||
cave = Cave.objects.get(kataster_number=kataster_number, areacode="1623")
|
cave = Cave.objects.get(kataster_number=kataster_number, areacode="1623")
|
||||||
notablecaves.append(cave)
|
notablecaves.append(cave)
|
||||||
except:
|
except:
|
||||||
print(" ! FAILED to get only one cave per kataster_number OR invalid number for: "+kataster_number)
|
print(" ! Notable Caves: FAILED to get only one cave per kataster_number OR invalid number for: "+kataster_number)
|
||||||
|
|
||||||
|
try:
|
||||||
hc = Cave.objects.get(kataster_number=359, areacode="1626")
|
hc = Cave.objects.get(kataster_number=359, areacode="1626")
|
||||||
notablecaves.append(hc)
|
notablecaves.append(hc)
|
||||||
|
except:
|
||||||
|
# fails during the tests because this cave has not been loaded for tests, so catch it here.
|
||||||
|
pass
|
||||||
print(notablecaves)
|
print(notablecaves)
|
||||||
return notablecaves
|
return notablecaves
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user