MCPcopy
hub / github.com/django/django / _parse_json

Method _parse_json

django/test/client.py:948–956  ·  view source on GitHub ↗
(self, response, **extra)

Source from the content-addressed store, hash-verified

946 self.cookies = SimpleCookie()
947
948 def _parse_json(self, response, **extra):
949 if not hasattr(response, "_json"):
950 if not JSON_CONTENT_TYPE_RE.match(response.get("Content-Type")):
951 raise ValueError(
952 'Content-Type header is "%s", not "application/json"'
953 % response.get("Content-Type")
954 )
955 response._json = json.loads(response.text, **extra)
956 return response._json
957
958 def _follow_redirect(
959 self,

Callers

nothing calls this directly

Calls 3

matchMethod · 0.45
getMethod · 0.45
loadsMethod · 0.45

Tested by

no test coverage detected