aboutsummaryrefslogtreecommitdiff
path: root/budget/tests/tests.py
diff options
context:
space:
mode:
author0livd <0livd@users.noreply.github.com>2017-05-16 23:21:41 +0100
committerAlexis Metaireau <alexis@notmyidea.org>2017-05-17 00:21:41 +0200
commit091553be566d97816ed898207b56d2694eb2efdd (patch)
tree143d65b70c5ce1b45d9300a91621aeb18aac5c82 /budget/tests/tests.py
parent4410aaa5041d2fd438b8138d5c5242d8f5e23d85 (diff)
downloadihatemoney-mirror-091553be566d97816ed898207b56d2694eb2efdd.zip
ihatemoney-mirror-091553be566d97816ed898207b56d2694eb2efdd.tar.gz
ihatemoney-mirror-091553be566d97816ed898207b56d2694eb2efdd.tar.bz2
Add ACTIVATE_DEMO_PROJECT setting (#209)
When set to False (True by default), it deactivates the demo project
Diffstat (limited to 'budget/tests/tests.py')
-rw-r--r--budget/tests/tests.py7
1 files changed, 7 insertions, 0 deletions
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('<a href="/create?project_id=demo">', resp.data.decode('utf-8'))
+
def test_authentication(self):
# try to authenticate without credentials should redirect
# to the authentication page