aboutsummaryrefslogtreecommitdiff
path: root/budget/tests.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-10-08 15:52:12 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-10-08 15:52:12 +0200
commit75209aeed0140c804047b4f3466d329b9eb246b9 (patch)
tree51cbe453bc31e3418e050f0e780ac99e3c57ba92 /budget/tests.py
parent1338653bd2234a60eab368f58dcd8d2bcb3f3d6b (diff)
downloadihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.zip
ihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.tar.gz
ihatemoney-mirror-75209aeed0140c804047b4f3466d329b9eb246b9.tar.bz2
Add a password recovery feature. Fix #32
Diffstat (limited to 'budget/tests.py')
-rw-r--r--budget/tests.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/budget/tests.py b/budget/tests.py
index 2b573f4..a3fbd89 100644
--- a/budget/tests.py
+++ b/budget/tests.py
@@ -96,6 +96,24 @@ class BudgetTestCase(TestCase):
self.assertEqual(len(outbox), 0)
+ def test_password_reminder(self):
+ # test that it is possible to have an email cotaining the password of a
+ # project in case people forget it (and it happens!)
+
+ self.create_project("raclette")
+
+ with run.mail.record_messages() as outbox:
+ # a nonexisting project should not send an email
+ self.app.post("/password-reminder", data={"id": "unexisting"})
+ self.assertEqual(len(outbox), 0)
+
+ # a mail should be sent when a project exists
+ self.app.post("/password-reminder", data={"id": "raclette"})
+ self.assertEqual(len(outbox), 1)
+ self.assertIn("raclette", outbox[0].body)
+ self.assertIn("raclette@notmyidea.org", outbox[0].recipients)
+
+
def test_project_creation(self):
with run.app.test_client() as c: