Created
February 6, 2013 17:29
-
-
Save PuercoPop/4724228 to your computer and use it in GitHub Desktop.
Test case for freezegun that fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# To run py.test test.py | |
from datetime import datetime | |
from freezegun import freeze_time | |
class A(object): | |
def __init__(self): | |
self.date = datetime.now() | |
def test_(): | |
with freeze_time("1990-01-01 18:00:00"): | |
a = A() | |
assert a.date.year == 1990 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment