api docs: Removing order dependency of deactivate user test.

We create a User using `do_create_user`, before running the
deactivation test.  This lets us removing the ordering logic
introduced in 7c17bdb9c5.
This commit is contained in:
Harsh Srivastava
2020-09-14 20:53:17 +05:30
committed by Tim Abbott
parent ff94254598
commit ba36624442
2 changed files with 17 additions and 5 deletions

View File

@@ -34,10 +34,7 @@ def test_generated_curl_examples_for_success(client: Client) -> None:
# on "add" tests coming before "remove" tests in some cases. We
# should try to either avoid ordering dependencies or make them
# very explicit.
for file_name in sorted(
glob.glob("templates/zerver/api/*.md"),
key=lambda file_name: (file_name == "templates/zerver/api/deactivate-user.md", file_name),
):
for file_name in sorted(glob.glob("templates/zerver/api/*.md")):
documentation_lines = open(file_name).readlines()
for line in documentation_lines:
# A typical example from the Markdown source looks like this: