aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-01-19 21:48:10 +0100
committerDaniel Schadt <kingdread@gmx.de>2023-01-19 21:56:04 +0100
commita03e5ecaaaba8d89280b19411d15579107ceaf8f (patch)
tree00ba17c88c2ba0715aec000ee643835399c5813a /tests
parentd3161f5c05d8ad652007c05d6b6861cdb17b9abd (diff)
downloadfietsboek-a03e5ecaaaba8d89280b19411d15579107ceaf8f.tar.gz
fietsboek-a03e5ecaaaba8d89280b19411d15579107ceaf8f.tar.bz2
fietsboek-a03e5ecaaaba8d89280b19411d15579107ceaf8f.zip
add a small test for maintenance mode
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/test_smoke.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/integration/test_smoke.py b/tests/integration/test_smoke.py
index 1288da0..5176e88 100644
--- a/tests/integration/test_smoke.py
+++ b/tests/integration/test_smoke.py
@@ -2,3 +2,15 @@ def test_home(testapp):
res = testapp.get("/")
assert res.status_code == 200
assert b'<h1>Home</h1>' in res.body
+
+
+def test_maintenance(testapp, data_manager):
+ # Enable the maintenance mode:
+ (data_manager.data_dir / "MAINTENANCE").write_text("Abbruch, abbruch!")
+
+ try:
+ res = testapp.get("/", status=503)
+ assert b"Abbruch, abbruch" in res.body
+ finally:
+ # Make sure we disable maintenance mode for the following tests
+ (data_manager.data_dir / "MAINTENANCE").unlink()