api: Document DELETE ../users/{user_id} endpoint.

This adds deactivate_user to python_examples.py in zerver/openapi.
This also adds delete-user.md to templates/zerver/api and adds
delete-user to rest-endpoints.md (templates/zerver/help/include).
This commit is contained in:
akashaviator
2020-02-15 02:32:24 +05:30
committed by Tim Abbott
parent 08efb00321
commit dc6a5e3ca2
3 changed files with 56 additions and 0 deletions

View File

@@ -242,6 +242,21 @@ def get_single_user(client):
validate_against_openapi_schema(result, '/users/{user_id}', 'get', '200')
@openapi_test_function("/users/{user_id}:delete")
def deactivate_user(client):
# type: (Client) -> None
# {code_example|start}
# Deactivate a user
user_id = 8
url = 'users/' + str(user_id)
result = client.call_endpoint(
url=url,
method='DELETE',
)
# {code_example|end}
validate_against_openapi_schema(result, '/users/{user_id}', 'delete', '200')
@openapi_test_function("/realm/filters:get")
def get_realm_filters(client):
# type: (Client) -> None
@@ -1150,6 +1165,7 @@ def test_users(client):
create_user(client)
get_members(client)
get_single_user(client)
deactivate_user(client)
get_profile(client)
update_notification_settings(client)
upload_file(client)