Skip to content

Instantly share code, notes, and snippets.

@klement97
Created January 4, 2021 21:20
Show Gist options
  • Save klement97/b177c9315d7b737379f27aedd7fae972 to your computer and use it in GitHub Desktop.
Save klement97/b177c9315d7b737379f27aedd7fae972 to your computer and use it in GitHub Desktop.
@pytest.mark.django_db
def test_order_save(monkeypatch):
def mock_post(*args, **kwargs):
return None
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