Example #1
0
    def test_relative_datetime_now_with_tzinfo(self, monkeypatch):
        monkeypatch.setattr("datestuff.relative.datetime", FakeDateTime)
        rdt = RelativeDateTime.now(UTC)

        assert within_delta(rdt, FakeDateTime.now(UTC), timedelta(seconds=1))
Example #2
0
    def test_relative_datetime_now_with_tzinfo(self, monkeypatch):
        monkeypatch.setattr('datestuff.relative.datetime', FakeDateTime)
        rdt = RelativeDateTime.now(UTC)

        assert within_delta(rdt, FakeDateTime.now(UTC), timedelta(seconds=1))
Example #3
0
    def test_relative_datetime_now(self, monkeypatch):
        monkeypatch.setattr("datestuff.relative.datetime", FakeDateTime)
        rdt = RelativeDateTime.now()

        # just need to know it is close enough
        assert within_delta(rdt, FakeDateTime.now(), timedelta(seconds=1))
Example #4
0
    def test_relative_datetime_now(self, monkeypatch):
        monkeypatch.setattr('datestuff.relative.datetime', FakeDateTime)
        rdt = RelativeDateTime.now()

        # just need to know it is close enough
        assert within_delta(rdt, FakeDateTime.now(), timedelta(seconds=1))