From b70476cf8f9dab4b36d2837aacf0df4f0fece217 Mon Sep 17 00:00:00 2001 From: Leo Mouyna Date: Sat, 28 Sep 2019 14:58:46 +0200 Subject: [PATCH] fix unit tests --- ihatemoney/tests/tests.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index a7d70ce1..5043977e 100644 --- a/ihatemoney/tests/tests.py +++ b/ihatemoney/tests/tests.py @@ -1282,6 +1282,7 @@ class APITestCase(IhatemoneyTestCase): 'payer': "1", 'payed_for': ["1", "2"], 'amount': '25', + 'external_link': "https://raclette.fr" }, headers=self.get_auth("raclette")) # should return the id @@ -1302,7 +1303,9 @@ class APITestCase(IhatemoneyTestCase): {"activated": True, "id": 2, "name": "fred", "weight": 1}], "amount": 25.0, "date": "2011-08-10", - "id": 1} + "id": 1, + 'external_link': "https://raclette.fr" + } got = json.loads(req.data.decode('utf-8')) self.assertEqual( @@ -1325,6 +1328,7 @@ class APITestCase(IhatemoneyTestCase): 'payer': "1", 'payed_for': ["1", "2"], 'amount': '25', + 'external_link': "https://raclette.fr", }, headers=self.get_auth("raclette")) self.assertStatus(400, req) @@ -1337,6 +1341,7 @@ class APITestCase(IhatemoneyTestCase): 'payer': "2", 'payed_for': ["1", "2"], 'amount': '25', + 'external_link': "https://raclette.fr", }, headers=self.get_auth("raclette")) # check its fields @@ -1355,7 +1360,9 @@ class APITestCase(IhatemoneyTestCase): {"activated": True, "id": 2, "name": "fred", "weight": 1}], "amount": 25.0, "date": "2011-09-10", - "id": 1} + 'external_link': "https://raclette.fr", + "id": 1 + } got = json.loads(req.data.decode('utf-8')) self.assertEqual( @@ -1427,6 +1434,7 @@ class APITestCase(IhatemoneyTestCase): "amount": expected_amount, "date": "2011-08-10", "id": id, + "external_link": '', } got = json.loads(req.data.decode('utf-8')) @@ -1538,7 +1546,9 @@ class APITestCase(IhatemoneyTestCase): {"activated": True, "id": 2, "name": "freddy familly", "weight": 4}], "amount": 25.0, "date": "2011-08-10", - "id": 1} + "id": 1, + "external_link": '' + } got = json.loads(req.data.decode('utf-8')) self.assertEqual( creation_date, @@ -1603,7 +1613,7 @@ class CommandTestCase(BaseTestCase): def test_generate_password_hash(self): cmd = GeneratePasswordHash() with patch('sys.stdout', new=six.StringIO()) as stdout, \ - patch('getpass.getpass', new=lambda prompt: 'secret'): # NOQA + patch('getpass.getpass', new=lambda prompt: 'secret'): # NOQA cmd.run() print(stdout.getvalue()) self.assertEqual(len(stdout.getvalue().strip()), 189)