Exemplo n.º 1
0
 def test_natural(self):
     now = timezone.now()
     for diff, expected in TEST_DATA:
         testdate = now + datetime.timedelta(seconds=diff)
         result = naturaltime(testdate, now)
         expected = '<span title="{0}">{1}</span>'.format(testdate.replace(microsecond=0).isoformat(), expected)
         self.assertEqual(expected, result, 'naturaltime(%s) "%s" != "%s"' % (testdate, result, expected))
Exemplo n.º 2
0
 def test_natural(self):
     now = timezone.now()
     for diff, expected in TEST_DATA:
         testdate = now + datetime.timedelta(seconds=diff)
         result = naturaltime(testdate, now)
         self.assertEqual(
             expected, result, 'naturaltime(%s) [%s] != "%s"' % (
                 testdate,
                 result,
                 expected,
             ))
Exemplo n.º 3
0
 def test_natural(self):
     now = timezone.now()
     for diff, expected in TEST_DATA:
         testdate = now + datetime.timedelta(seconds=diff)
         result = naturaltime(testdate, now)
         self.assertEqual(
             expected, result,
             'naturaltime(%s) [%s] != "%s"' % (
                 testdate, result, expected,
             )
         )
Exemplo n.º 4
0
 def test_natural(self):
     now = timezone.now()
     for diff, expected in TEST_DATA:
         testdate = now + datetime.timedelta(seconds=diff)
         result = naturaltime(testdate, now)
         expected = '<span title="{0}">{1}</span>'.format(
             testdate.replace(microsecond=0).isoformat(),
             expected,
         )
         self.assertEqual(
             expected, result, 'naturaltime({0}) "{1}" != "{2}"'.format(
                 testdate, result, expected))