diff options
| author | Byron Ullauri <Ullauri.Byron@gmail.com> | 2018-12-26 13:07:09 -0500 |
|---|---|---|
| committer | Alexis Metaireau <alexis@notmyidea.org> | 2018-12-26 19:07:09 +0100 |
| commit | 7cb339c0bb8aacaeae47838a68c7af60cf414618 (patch) | |
| tree | 9b404ea1b24d27af890daf26ecaa4604ac925678 /ihatemoney/tests/tests.py | |
| parent | 620596e32cbacac62d79d1a9f82cd57136b95b52 (diff) | |
| download | ihatemoney-mirror-7cb339c0bb8aacaeae47838a68c7af60cf414618.zip ihatemoney-mirror-7cb339c0bb8aacaeae47838a68c7af60cf414618.tar.gz ihatemoney-mirror-7cb339c0bb8aacaeae47838a68c7af60cf414618.tar.bz2 | |
Resolve "Update API project list" (#409)
* refactoring models _to_serialize property
* updated project api members list
* addressing flake8: line too long
Diffstat (limited to 'ihatemoney/tests/tests.py')
| -rw-r--r-- | ihatemoney/tests/tests.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py index 17b3a8d..2f3d4ac 100644 --- a/ihatemoney/tests/tests.py +++ b/ihatemoney/tests/tests.py @@ -1084,12 +1084,10 @@ class APITestCase(IhatemoneyTestCase): self.assertTrue(200, resp.status_code) expected = { - "active_members": [], + "members": [], "name": "raclette", "contact_email": "raclette@notmyidea.org", - "members": [], "id": "raclette", - "balance": {}, } decoded_resp = json.loads(resp.data.decode('utf-8')) self.assertDictEqual(decoded_resp, expected) @@ -1108,12 +1106,10 @@ class APITestCase(IhatemoneyTestCase): self.assertEqual(200, resp.status_code) expected = { - "active_members": [], "name": "The raclette party", "contact_email": "yeah@notmyidea.org", "members": [], "id": "raclette", - "balance": {}, } decoded_resp = json.loads(resp.data.decode('utf-8')) self.assertDictEqual(decoded_resp, expected) @@ -1449,21 +1445,16 @@ class APITestCase(IhatemoneyTestCase): headers=self.get_auth("raclette")) expected = { - "active_members": [ - {"activated": True, "id": 1, "name": "alexis", "weight": 1.0}, - {"activated": True, "id": 2, "name": "freddy familly", "weight": 4.0}, - {"activated": True, "id": 3, "name": "arnaud", "weight": 1.0} + "members": [ + {"activated": True, "id": 1, "name": "alexis", "weight": 1.0, "balance": 20.0}, + {"activated": True, "id": 2, "name": "freddy familly", "weight": 4.0, + "balance": -20.0}, + {"activated": True, "id": 3, "name": "arnaud", "weight": 1.0, "balance": 0}, ], - "balance": {"1": 20.0, "2": -20.0, "3": 0}, "contact_email": "raclette@notmyidea.org", "id": "raclette", - - "members": [ - {"activated": True, "id": 1, "name": "alexis", "weight": 1.0}, - {"activated": True, "id": 2, "name": "freddy familly", "weight": 4.0}, - {"activated": True, "id": 3, "name": "arnaud", "weight": 1.0} - ], - "name": "raclette"} + "name": "raclette", + } self.assertStatus(200, req) decoded_req = json.loads(req.data.decode('utf-8')) |
