Exemple #1
0
    def test_assert_datetimes_equal(self):
        # times are compared to the millisecond, so this ought to pass
        t0 = datetime.now()
        t1 = datetime.now()
        assert_datetimes_equal(t0, t1)

        t0 = datetime(1970, 1, 1)
        t1 = datetime(1970, 1, 1)
        assert_datetimes_equal(t0, t1)
Exemple #2
0
 def test_assert_datetimes_equal(self):
     with assert_raises(AssertionError):
         assert_datetimes_equal(datetime(1970, 1, 1), datetime.now())