Skip to content

Instantly share code, notes, and snippets.

@briggleman
Created June 19, 2019 19:57
Show Gist options
  • Save briggleman/bdbf7bad04d4529878eabc06d00d82c7 to your computer and use it in GitHub Desktop.
Save briggleman/bdbf7bad04d4529878eabc06d00d82c7 to your computer and use it in GitHub Desktop.
@pytest.fixture(autouse=True)
def today():
return datetime(2018, 4, 17, 22, 42, 41, 717625)
@pytest.fixture(autouse=True)
def miso(today):
# patches the datetime function in helpers.response
# to use this patch call miso.isoformat() in the response to render the same time
with mock.patch("sea.helpers.response.converters.datetime") as mocked:
mocked.isoformat.return_value = datetime.isoformat(today)
yield mocked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment