@pytest.fixture
def mock_okapi_failure(monkeypatch, mocker: MockerFixture):

    def mock_post(*args, **kwargs):
        post_response = mocker.stub(name='post_result')
        post_response.status_code = 422
        post_response.text = '{\n            "errors" : [ {\n                "message" : "value already exists in table holdings_record: hld100000000027"\n            } ]\n        }'
        return post_response
    monkeypatch.setattr(requests, 'post', mock_post)
@pytest.fixture
def mock_okapi_failure(monkeypatch, mocker: MockerFixture):

    def mock_post(*args, **kwargs):
        post_response = mocker.stub(name='post_result')
        post_response.status_code = 422
        post_response.text = '{\n            "errors" : [ {\n                "message" : "value already exists in table holdings_record: hld100000000027"\n            } ]\n        }'
        return post_response
    monkeypatch.setattr(requests, 'post', mock_post)