def METHOD_NAME(self, res, expected_in_body=None):
    content_type = res.headers.get("Content-Type")
    assert "application/json" in content_type, content_type
    res_json = self.loads(res.body)
    if expected_in_body:
        assert expected_in_body in res_json or expected_in_body in str(
            res_json
        ), (
            "Expected to find %r in JSON response %r"
            % (expected_in_body, res_json)
        )