Skip to content

asserting status code before decoding json in assertResponseNoErrors  #684

@dan-klasson

Description

@dan-klasson

On a 404 with debug set to True the json decode will fail. self.assertEqual(resp.status_code, 200) should come before json.loads(resp.content).

    def assertResponseNoErrors(self, resp):
        content = json.loads(resp.content)
        self.assertEqual(resp.status_code, 200)
        self.assertNotIn("errors", list(content.keys()))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions