diff --git a/tests/datetimes/tests.py b/tests/datetimes/tests.py
index f54b30d..cea73c8 100644
a
|
b
|
|
1 | 1 | from __future__ import unicode_literals |
2 | 2 | |
3 | 3 | import datetime |
| 4 | from unittest import skipIf |
| 5 | |
| 6 | try: |
| 7 | import pytz |
| 8 | except ImportError: |
| 9 | pytz = None |
| 10 | |
| 11 | from django.test import TestCase, override_settings |
| 12 | from django.utils import timezone |
4 | 13 | |
5 | | from django.test import TestCase |
6 | 14 | |
7 | 15 | from .models import Article, Comment, Category |
8 | 16 | |
… |
… |
class DateTimesTests(TestCase):
|
81 | 89 | ], |
82 | 90 | lambda d: d, |
83 | 91 | ) |
| 92 | |
| 93 | @skipIf(pytz is None, "this test requires pytz") |
| 94 | @override_settings(USE_TZ=True, TIME_ZONE='Europe/Paris') |
| 95 | def test_21432(self): |
| 96 | now = timezone.now() |
| 97 | Article.objects.create(title="First one", pub_date=now) |
| 98 | qs = Article.objects.datetimes('pub_date', 'year') |
| 99 | self.assertEqual(repr(qs), "[%s]" % now) |