def test_json_or_error_raises_404(self):
        response_mock = Mock()
        response_mock.url = 'http://nowhere.example.com'
        response_mock.status_code = 404
        response_mock.text = 'Where?'

        with self.assertRaisesMessage(
                JsonApiError,
                'API request to http://nowhere.example.com failed with HTTP status 404: Where?'):
            JsonApiRequest.json_or_error(response_mock)
JsonApiRequest.json_or_error should raise an error on HTTP status 404
dataset/ETHPy150Open dimagi/commcare-hq/custom/dhis2/tests.py/JsonApiRequestTest.test_json_or_error_raises_404