Commit 8e3b4ad9 authored by Federico Ceratto's avatar Federico Ceratto

Imported Upstream version 0.1.18

parent b37b9257
Metadata-Version: 1.0
Name: freezegun
Version: 0.1.17
Version: 0.1.18
Summary: Let your Python tests travel through time
Home-page: https://github.com/spulec/freezegun
Author: Steve Pulec
......
Metadata-Version: 1.0
Name: freezegun
Version: 0.1.17
Version: 0.1.18
Summary: Let your Python tests travel through time
Home-page: https://github.com/spulec/freezegun
Author: Steve Pulec
......
......@@ -10,7 +10,7 @@ freezegun
"""
__title__ = 'freezegun'
__version__ = '0.1.16'
__version__ = '0.1.18'
__author__ = 'Steve Pulec'
__license__ = 'Apache License 2.0'
__copyright__ = 'Copyright 2012 Steve Pulec'
......
......@@ -117,6 +117,10 @@ class FakeDatetime(with_metaclass(FakeDatetimeMeta, real_datetime, FakeDate)):
result = cls.time_to_freeze + datetime.timedelta(hours=cls.tz_offset)
return datetime_to_fakedatetime(result)
@classmethod
def today(cls):
return cls.now(tz=None)
@classmethod
def utcnow(cls):
result = cls.time_to_freeze
......
......@@ -13,7 +13,7 @@ else:
setup(
name='freezegun',
version='0.1.17',
version='0.1.18',
description='Let your Python tests travel through time',
author='Steve Pulec',
author_email='spulec@gmail',
......
......@@ -48,7 +48,7 @@ def test_simple_api():
assert datetime.datetime.now() == datetime.datetime(2012, 1, 14)
assert datetime.datetime.utcnow() == datetime.datetime(2012, 1, 14)
assert datetime.date.today() == datetime.date(2012, 1, 14)
assert datetime.datetime.now().today() == datetime.date(2012, 1, 14)
assert datetime.datetime.now().today() == datetime.datetime(2012, 1, 14)
freezer.stop()
assert time.time() != expected_timestamp
assert datetime.datetime.now() != datetime.datetime(2012, 1, 14)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment