X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/git-favicon.png?a=blobdiff_plain;f=tests%2Fdays.py;h=c6fdcc783db16bdd637d7944ced84ddfe19a2622;hb=17be4d0a78f3d1b56df588807b6bda05bb2d8ebc;hp=06e4302d71aaba58867e961506806a792c1fe807;hpb=37ad3f2181d8bacd2a9d48e8fca4ede1e24de6b6;p=plomtask diff --git a/tests/days.py b/tests/days.py index 06e4302..c6fdcc7 100644 --- a/tests/days.py +++ b/tests/days.py @@ -91,7 +91,7 @@ class TestsWithServer(TestCaseWithServer): """Tests against our HTTP server/handler (and database).""" def test_do_GET(self) -> None: - """Test /day and /calendar response codes.""" + """Test /day and /calendar response codes, and / redirect.""" self.conn.request('GET', '/day') self.assertEqual(self.conn.getresponse().status, 200) self.conn.request('GET', '/day?date=3000-01-01') @@ -108,3 +108,7 @@ class TestsWithServer(TestCaseWithServer): self.assertEqual(self.conn.getresponse().status, 200) self.conn.request('GET', '/calendar?start=foo') self.assertEqual(self.conn.getresponse().status, 400) + self.conn.request('GET', '/') + response = self.conn.getresponse() + self.assertEqual(response.status, 302) + self.assertEqual(response.getheader('Location'), '/day')