2
0
Эх сурвалжийг харах

Because the filter tests take non-zero time to pass, it's possible for one of
the timeuntil tests to fail because the pre-recorded "now" has moved on
sufficiently far from actual "now()". Fixed the one test that was failing for
me (the other timeuntil and timesince tests already have a small buffer built
in to guard against this problem).

The problem was revealed after [8535].


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8556 bcc190cf-cafb-0310-a4f2-bffc1f526a37

Malcolm Tredinnick 16 жил өмнө
parent
commit
b46e736c9a

+ 1 - 1
tests/regressiontests/templates/filters.py

@@ -58,7 +58,7 @@ def get_filter_tests():
         # Regression for #7443
         'filter-timeuntil06': ('{{ earlier|timeuntil }}', { 'earlier': now - timedelta(days=7) }, '0 minutes'),
         'filter-timeuntil07': ('{{ earlier|timeuntil:now }}', { 'now': now, 'earlier': now - timedelta(days=7) }, '0 minutes'),
-        'filter-timeuntil08': ('{{ later|timeuntil }}', { 'later': now + timedelta(days=7) }, '1 week'),
+        'filter-timeuntil08': ('{{ later|timeuntil }}', { 'later': now + timedelta(days=7, hours=1) }, '1 week'),
         'filter-timeuntil09': ('{{ later|timeuntil:now }}', { 'now': now, 'later': now + timedelta(days=7) }, '1 week'),