diff options
| author | Alexis Metaireau <alexis@notmyidea.org> | 2019-10-06 21:20:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-06 21:20:47 +0200 |
| commit | 4b01276d60ed56de0a64d3122910e6b10577bce7 (patch) | |
| tree | f6e5458ef4d556e8d452aa2e1a55eac9cc600ce4 /ihatemoney/tests | |
| parent | 1f539b5c0d6d68897bcdb4cdf1f3f81debac49a9 (diff) | |
| parent | e453c917ed630614cbc6ed1400833b344548a504 (diff) | |
| download | ihatemoney-mirror-4b01276d60ed56de0a64d3122910e6b10577bce7.zip ihatemoney-mirror-4b01276d60ed56de0a64d3122910e6b10577bce7.tar.gz ihatemoney-mirror-4b01276d60ed56de0a64d3122910e6b10577bce7.tar.bz2 | |
Merge pull request #479 from LeoMouyna:feature/external-link-bill-form
feat: Optional field 'external link' in bill form.
Diffstat (limited to 'ihatemoney/tests')
| -rw-r--r-- | ihatemoney/tests/tests.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index a7d70ce..5043977 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) |
