From 091553be566d97816ed898207b56d2694eb2efdd Mon Sep 17 00:00:00 2001 From: 0livd <0livd@users.noreply.github.com> Date: Tue, 16 May 2017 23:21:41 +0100 Subject: Add ACTIVATE_DEMO_PROJECT setting (#209) When set to False (True by default), it deactivates the demo project --- budget/tests/tests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'budget/tests') diff --git a/budget/tests/tests.py b/budget/tests/tests.py index d979a29..e18e9c3 100644 --- a/budget/tests/tests.py +++ b/budget/tests/tests.py @@ -331,6 +331,13 @@ class BudgetTestCase(TestCase): self.app.get("/demo") self.assertTrue(models.Project.query.get("demo") is not None) + def test_deactivated_demo(self): + run.app.config['ACTIVATE_DEMO_PROJECT'] = False + + # test redirection to the create project form when demo is deactivated + resp = self.app.get("/demo") + self.assertIn('', resp.data.decode('utf-8')) + def test_authentication(self): # try to authenticate without credentials should redirect # to the authentication page -- cgit v1.1