Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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/'