realm/playground: Add API endpoint for deleting a playground entry.

Similar to the previous commit, we have added a `do_*` function
which does the deletion from the DB. The next commit handles sending
the events when both adding and deleting a playground entry.

Added the openAPI format data to zulip.yaml for DELETE
/realm/playgrounds/{playground_id}. Also added python and curl
examples to remove-playground.md.

Tests added.
This commit is contained in:
Sumanth V Rao
2020-10-27 06:51:22 +05:30
parent 251b415987
commit d2e5b62dce
9 changed files with 129 additions and 3 deletions

View File

@@ -396,6 +396,17 @@ def add_realm_playground(client: Client) -> None:
validate_against_openapi_schema(result, "/realm/playgrounds", "post", "200")
@openapi_test_function("/realm/playgrounds/{playground_id}:delete")
def remove_realm_playground(client: Client) -> None:
# {code_example|start}
# Remove the playground with ID 1
result = client.call_endpoint(url="/realm/playgrounds/1", method="DELETE")
# {code_example|end}
validate_against_openapi_schema(result, "/realm/playgrounds/{playground_id}", "delete", "200")
@openapi_test_function("/users/me:get")
def get_profile(client: Client) -> None:
@@ -1436,6 +1447,7 @@ def test_server_organizations(client: Client) -> None:
add_realm_playground(client)
get_server_settings(client)
remove_realm_filter(client)
remove_realm_playground(client)
get_realm_emoji(client)
upload_custom_emoji(client)
get_realm_profile_fields(client)