def test_datatypes_datehelpers_tomorrow(): assert TimexDateHelpers.tomorrow(datetime(2016, 12, 31)) == datetime(2017, 1, 1) assert TimexDateHelpers.tomorrow(datetime(2017, 1, 1)) == datetime(2017, 1, 2) assert TimexDateHelpers.tomorrow(datetime(2017, 2, 28)) == datetime(2017, 3, 1) assert TimexDateHelpers.tomorrow(datetime(2016, 2, 28)) == datetime(2016, 2, 29)
def test_datatypes_datehelpers_invariance(): d = datetime(2017, 8, 25) before = d TimexDateHelpers.tomorrow(d) TimexDateHelpers.yesterday(d) TimexDateHelpers.date_part_equal(datetime.now(), d) TimexDateHelpers.date_part_equal(d, datetime.now()) TimexDateHelpers.is_next_week(d, datetime.now()) TimexDateHelpers.is_next_week(datetime.now(), d) TimexDateHelpers.is_last_week(datetime.now(), d) TimexDateHelpers.week_of_year(d) after = d assert after is before