api: Rewrite argument type test for clarity.

We refactor HostRequestMock so that it now proper populates the request
body given the post data, assuming that the request is JSON encoded.
This commit is contained in:
Zixuan James Li
2023-09-08 01:53:57 -04:00
committed by Tim Abbott
parent f4caf9dd79
commit 5a7b1065e5
2 changed files with 15 additions and 19 deletions

View File

@@ -358,7 +358,7 @@ class HostRequestMock(HttpRequest):
self.META = meta_data
self.path = path
self.user = user_profile or AnonymousUser()
self._body = b""
self._body = orjson.dumps(post_data)
self.content_type = ""
RequestNotes.set_notes(