aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/tests
diff options
context:
space:
mode:
authorJocelynDelalande <JocelynDelalande@users.noreply.github.com>2017-12-27 19:00:09 +0100
committerGitHub <noreply@github.com>2017-12-27 19:00:09 +0100
commit2dd7a0740a6a072e522c00fe6f9bdf8f34bd3cf0 (patch)
tree16d5b090bf81f6b71d83761dac1b9e50df53c412 /ihatemoney/tests
parent1c9120e68bc00f0a4e4c8776a0360939331f8e73 (diff)
parent867f77905b3fc235b3082d329b22d223738f02d4 (diff)
downloadihatemoney-mirror-2dd7a0740a6a072e522c00fe6f9bdf8f34bd3cf0.zip
ihatemoney-mirror-2dd7a0740a6a072e522c00fe6f9bdf8f34bd3cf0.tar.gz
ihatemoney-mirror-2dd7a0740a6a072e522c00fe6f9bdf8f34bd3cf0.tar.bz2
Merge pull request #299 from spiral-project/fix-duplicate-member-validation
Fix duplicate member validation
Diffstat (limited to 'ihatemoney/tests')
-rw-r--r--ihatemoney/tests/tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ihatemoney/tests/tests.py b/ihatemoney/tests/tests.py
index 97e9df3..b605889 100644
--- a/ihatemoney/tests/tests.py
+++ b/ihatemoney/tests/tests.py
@@ -1153,7 +1153,13 @@ class APITestCase(IhatemoneyTestCase):
self.assertStatus(200, req)
self.assertEqual(len(json.loads(req.data.decode('utf-8'))), 1)
- # edit this member
+ # Try to add another member with the same name.
+ req = self.client.post("/api/projects/raclette/members", data={
+ "name": "Alexis"
+ }, headers=self.get_auth("raclette"))
+ self.assertStatus(400, req)
+
+ # edit the member
req = self.client.put("/api/projects/raclette/members/1", data={
"name": "Fred",
"weight": 2,