diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-05-03 20:35:35 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-05-03 20:35:35 +0100 |
commit | 9b9f6720e079669fd884d83f6b69833e20d03ff7 (patch) | |
tree | 9f54c736d5e1514a03018dd1e9dcbd720d00fc16 /core/TESTS | |
parent | 254b465755f7ebfc1650730ac2d51bb33543a85c (diff) | |
download | troggle-9b9f6720e079669fd884d83f6b69833e20d03ff7.tar.gz troggle-9b9f6720e079669fd884d83f6b69833e20d03ff7.tar.bz2 troggle-9b9f6720e079669fd884d83f6b69833e20d03ff7.zip |
not found now does 404 & moved login
Diffstat (limited to 'core/TESTS')
-rw-r--r-- | core/TESTS/tests.py | 6 | ||||
-rw-r--r-- | core/TESTS/tests_caves.py | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index 7a12637..b376840 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -75,7 +75,7 @@ class PageTests(TestCase): def test_expoweb_dir_no_index(self): response = self.client.get('/handbook/troggle') content = response.content.decode() - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 404) ph = r'Page not found handbook/troggle/index.html' phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") @@ -116,7 +116,7 @@ class PageTests(TestCase): def test_expoweb_notfound(self): response = self.client.get('/handbook/zyxxypqrqx.html') content = response.content.decode() - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 404) ph = r'<h1>Page not found' phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") @@ -367,7 +367,7 @@ class PageTests(TestCase): def test_page_photos_not_ok(self): # Flat file tests. response = self.client.get('/photos/2018/PhilipSargent/corin.jpeg') - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 404) content = response.content.decode() ph = r'<title>Page not found 2018/PhilipSargent/corin.jpeg</title>' phmatch = re.search(ph, content) diff --git a/core/TESTS/tests_caves.py b/core/TESTS/tests_caves.py index 8a08c71..13152f7 100644 --- a/core/TESTS/tests_caves.py +++ b/core/TESTS/tests_caves.py @@ -156,11 +156,11 @@ class FixturePageTests(TestCase): self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") def test_fix_cave_bare_url115(self): - '''Expect to get Page Not Found and status 200''' + '''Expect to get Page Not Found and status 404''' ph = self.ph ph = 'Probably a mistake.' response = self.client.get('/1623/115') - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 404) content = response.content.decode() phmatch = re.search(ph, content) @@ -168,11 +168,11 @@ class FixturePageTests(TestCase): def test_fix_cave_slug115(self): - '''Expect to get Page Not Found and status 200''' + '''Expect to get Page Not Found and status 404''' ph = self.ph ph = 'Probably a mistake.' response = self.client.get('/1623-115') - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 404) content = response.content.decode() phmatch = re.search(ph, content) |