aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/tests
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2019-08-31 22:54:23 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2019-09-06 22:00:39 +0200
commit9c9832704d67ccca11830cfaab886cf7f2fdcf0e (patch)
tree8fae0760a8306cb41404db107f75d4d133976096 /ihatemoney/tests
parenta467f463725d407a2517bd8e54f17c834a843d80 (diff)
downloadihatemoney-mirror-9c9832704d67ccca11830cfaab886cf7f2fdcf0e.zip
ihatemoney-mirror-9c9832704d67ccca11830cfaab886cf7f2fdcf0e.tar.gz
ihatemoney-mirror-9c9832704d67ccca11830cfaab886cf7f2fdcf0e.tar.bz2
bill list: add placeholder and disable add bill when no members
Diffstat (limited to 'ihatemoney/tests')
-rw-r--r--ihatemoney/tests/tests.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py
index 12ad128..02e58ae 100644
--- a/ihatemoney/tests/tests.py
+++ b/ihatemoney/tests/tests.py
@@ -178,7 +178,10 @@ class BudgetTestCase(IhatemoneyTestCase):
self.client.get("/exit")
# Test that we got a valid token
resp = self.client.get(url, follow_redirects=True)
- self.assertIn('You probably want to <a href="/raclette/add"', resp.data.decode('utf-8'))
+ self.assertIn(
+ 'You probably want to <a href="/raclette/members/add"',
+ resp.data.decode('utf-8')
+ )
# Test empty and invalid tokens
self.client.get("/exit")
resp = self.client.get("/authenticate")
@@ -275,6 +278,29 @@ class BudgetTestCase(IhatemoneyTestCase):
# project removed
self.assertEqual(len(models.Project.query.all()), 0)
+ def test_bill_placeholder(self):
+ self.post_project("raclette")
+ self.login("raclette")
+
+ result = self.client.get("/raclette/")
+
+ # Empty bill list and no members, should now propose to add members first
+ self.assertIn(
+ 'You probably want to <a href="/raclette/members/add"',
+ result.data.decode('utf-8')
+ )
+
+ result = self.client.post("/raclette/members/add",
+ data={'name': 'alexis'})
+
+ result = self.client.get("/raclette/")
+
+ # Empty bill with member, list should now propose to add bills
+ self.assertIn(
+ 'You probably want to <a href="/raclette/add"',
+ result.data.decode('utf-8')
+ )
+
def test_membership(self):
self.post_project("raclette")
self.login("raclette")