def test_about_page_works_even_when_db_is_down(self): alice = self.make_participant('alice') with patch.multiple(self.website, db=NoDB()): r = self.client.GET('/about/', auth_as=alice) assert r.code == 200 assert b"Liberapay is " in r.body
def test_stats_page_is_503_when_db_is_down(self): with patch.multiple(self.website, db=NoDB()): r = self.client.GET('/about/stats', raise_immediately=False) assert r.code == 503 assert b" technical failures." in r.body assert b" unable to process your request " in r.body
def test_homepage_redirects_when_db_is_down(self): with patch.multiple(self.website, db=NoDB()): r = self.client.GET('/', raise_immediately=False) assert r.code == 302 assert r.headers[b'Location'] == b'/about/'