tests: Refactor away result.json() calls with helpers.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-06-06 19:37:01 -04:00
committed by Tim Abbott
parent a6e2453323
commit a142fbff85
33 changed files with 345 additions and 419 deletions

View File

@@ -55,8 +55,7 @@ class MutedUsersTests(ZulipTestCase):
"bot_type": "1",
}
result = self.client_post("/json/bots", bot_info)
self.assert_json_success(result)
muted_id = result.json()["user_id"]
muted_id = self.assert_json_success(result)["user_id"]
url = f"/api/v1/users/me/muted_users/{muted_id}"
result = self.api_post(hamlet, url)