summaryrefslogtreecommitdiff
path: root/tests/generic_views/test_dates.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-10-01 09:27:31 +0200
committerClaude Paroz <claude@2xlibre.net>2013-10-01 13:20:41 +0200
commitc1c44b25062c3a793ac0d8416f369383a4a58cb4 (patch)
tree1846d34ee76fcdd8105c56d83756f0e896424655 /tests/generic_views/test_dates.py
parentd64060a73650360dcabfdb4928a9e92d090925b1 (diff)
Factorized requires_tz_support decorator in test utils
Thanks Aymeric Augustin for the suggestion. Refs #21165.
Diffstat (limited to 'tests/generic_views/test_dates.py')
-rw-r--r--tests/generic_views/test_dates.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py
index 03c6d02e5e..d15f6637fd 100644
--- a/tests/generic_views/test_dates.py
+++ b/tests/generic_views/test_dates.py
@@ -1,27 +1,14 @@
from __future__ import unicode_literals
-import time
import datetime
-from unittest import skipUnless
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, skipUnlessDBFeature
-from django.test.utils import override_settings
+from django.test.utils import override_settings, requires_tz_support
from django.utils import timezone
from .models import Book, BookSigning
-TZ_SUPPORT = hasattr(time, 'tzset')
-
-# On OSes that don't provide tzset (Windows), we can't set the timezone
-# in which the program runs. As a consequence, we must skip tests that
-# don't enforce a specific timezone (with timezone.override or equivalent),
-# or attempt to interpret naive datetimes in the default timezone.
-
-requires_tz_support = skipUnless(TZ_SUPPORT,
- "This test relies on the ability to run a program in an arbitrary "
- "time zone, but your operating system isn't able to do that.")
-
def _make_books(n, base_date):
for i in range(n):