diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-04-06 00:49:09 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-04-06 00:49:09 +0100 |
commit | d1cd72c5f88c581b8e446f3c92c0eb093500c60e (patch) | |
tree | 0b40a627ee461f1d03ca4b1a94e0c09d67b55e32 /core/TESTS/tests.py | |
parent | 6d6bec35f271b5ff072a884fbfc31f5b9cb36642 (diff) | |
download | troggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.tar.gz troggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.tar.bz2 troggle-d1cd72c5f88c581b8e446f3c92c0eb093500c60e.zip |
New user login/logoff system using standard Dj
Diffstat (limited to 'core/TESTS/tests.py')
-rw-r--r-- | core/TESTS/tests.py | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/core/TESTS/tests.py b/core/TESTS/tests.py index ec7de15..d7eeec3 100644 --- a/core/TESTS/tests.py +++ b/core/TESTS/tests.py @@ -126,18 +126,12 @@ class PageTests(TestCase): def test_expoweb_dir(self): response = self.client.get('/handbook') content = response.content.decode() - self.assertEqual(response.status_code, 200) - ph = r'Introduction to expo' - phmatch = re.search(ph, content) - self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + self.assertEqual(response.status_code, 302) # directory, so redirects to /index.htm def test_expoweb_dirslash(self): response = self.client.get('/handbook/') content = response.content.decode() - self.assertEqual(response.status_code, 200) - ph = r'Introduction to expo' - phmatch = re.search(ph, content) - self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + self.assertEqual(response.status_code, 302) # directory, so redirects to /index.htm def test_expoweb_dir_no_index(self): response = self.client.get('/handbook/troggle') @@ -147,6 +141,31 @@ class PageTests(TestCase): phmatch = re.search(ph, content) self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + def test_expoweb_dir_with_index_htm(self): + response = self.client.get('/years/1999/index.htm') + content = response.content.decode() + self.assertEqual(response.status_code, 200) # directory, so redirects to /index.htm + ph = r'Passage descriptions for 1999' + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + + def test_expoweb_dir_with_index_html(self): + response = self.client.get('/years/2015/index.html') + content = response.content.decode() + self.assertEqual(response.status_code, 200) # directory, so redirects to /index.htm + ph = r'Things left at top camp 2014' + phmatch = re.search(ph, content) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + + def test_expoweb_dir_with_index2(self): + response = self.client.get('/handbook/index.htm') + content = response.content.decode() + self.assertEqual(response.status_code, 200) + ph = r'Introduction to expo' + phmatch = re.search(ph, content) + #print("\n ! - test_expoweb_dir_with_index2\n{}\n{}".format(response.reason_phrase, content)) + self.assertIsNotNone(phmatch, "Failed to find expected text: '" + ph +"'") + def test_expoweb_htm(self): response = self.client.get('/handbook/index.htm') content = response.content.decode() @@ -234,9 +253,9 @@ class PageTests(TestCase): def test_page_folk(self): # This page is separately generated, so it has the full data content - response = self.client.get('/folk/') + response = self.client.get('/folk/index.htm') content = response.content.decode() - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 200) for ph in [ r'involves some active contribution', r'Naomi Griffiths', r'Gail Smith', |