"""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')
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')