Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save klement97/cc98f62221421a01a94d100f61c597fe to your computer and use it in GitHub Desktop.
Save klement97/cc98f62221421a01a94d100f61c597fe to your computer and use it in GitHub Desktop.
@pytest.mark.django_db
def test_order_save(monkeypatch):
def mock_post(*args, **kwargs):
return MockResponse()
monkeypatch.setattr(requests, 'post', mock_post)
order = create_order()
assert order.price is not None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment