api/create-user: Test fixture for "email already in use" error.

In templates/zerver/api/create-user.md, we have a sample fixture
for when a client attempts to create a user with the same email
as an existing user. This commit adds a test for that fixture.

Note that this error payload is specific to client.create_user
and this error payload isn't generated anywhere else.
This commit is contained in:
Eeshan Garg
2018-02-16 19:08:10 -03:30
committed by Tim Abbott
parent be0a04f33e
commit a0818975fb
3 changed files with 17 additions and 11 deletions

View File

@@ -108,7 +108,13 @@ def create_user(client):
result = client.create_user(request)
# {code_example|end}
fixture = FIXTURES['create-user']
fixture = FIXTURES['create-user']['successful_response']
test_against_fixture(result, fixture)
# Test "Email already used error"
result = client.create_user(request)
fixture = FIXTURES['create-user']['email_already_used_error']
test_against_fixture(result, fixture)
def get_members(client):