def test_13_weeks(self): self.assertAlmostEqual(parse("13week").seconds, (WEEK * 13).seconds)
def test_beginning_of_month(self): self.assertAlmostEqual(parse("today|month").unix, Date.today().floor(MONTH).unix)
def test_end_of_month(self): self.assertAlmostEqual(parse("today|month+month").unix, Date.today().floor(MONTH).add(MONTH).unix)
def test_week_before(self): self.assertAlmostEqual(parse("today-2week").unix, (Date.today() - WEEK * 2).unix)
def test_last_year(self): self.assertAlmostEqual(parse("today-12month").unix, (Date.today() - MONTH * 12).unix)
def test_next_week(self): self.assertAlmostEqual(parse("today+7day").unix, (Date.today() + DAY * 7).unix)
def test_last_week(self): self.assertAlmostEqual(parse("today-7day").unix, (Date.today() - DAY * 7).unix)
def test_yesterday(self): self.assertAlmostEqual(parse("today-day").unix, (Date.today() - DAY).unix)
def test_today(self): self.assertAlmostEqual(parse("today").unix, Date.today().unix)
def test_now(self): self.assertAlmostEqual(parse("now").unix, Date.now().unix, places=9) # IGNORE THE LEAST SIGNIFICANT MILLISECOND