Beispiel #1
0
    def test_negative(self):
        now = datetime.datetime(2000, 1, 1, 0, 0, 0)
        time = datetime.datetime(2000, 1, 2, 0, 0, 0)

        result = reports.format_age(now, time, "<%s>")

        self.assertEqual(result, '')
Beispiel #2
0
    def test_negative(self):
        now = datetime.datetime(2000, 1, 1, 0, 0, 0)
        time = datetime.datetime(2000, 1, 2, 0, 0, 0)

        result = reports.format_age(now, time, "<%s>")

        self.assertEqual(result, '')
Beispiel #3
0
    def test_normal(self):
        now = datetime.datetime(2000, 1, 1, 0, 0, 0)
        time = datetime.datetime(1999, 12, 31, 0, 0, 0)

        result = reports.format_age(now, time, "<%s>")

        self.assertEqual(result, '<1 day, 0:00:00>')
Beispiel #4
0
    def test_normal(self):
        now = datetime.datetime(2000, 1, 1, 0, 0, 0)
        time = datetime.datetime(1999, 12, 31, 0, 0, 0)

        result = reports.format_age(now, time, "<%s>")

        self.assertEqual(result, '<1 day, 0:00:00>')