diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py
index 98c089f..b4690c1 100644
a
|
b
|
from __future__ import absolute_import
|
3 | 3 | import datetime |
4 | 4 | |
5 | 5 | from django.core.exceptions import ImproperlyConfigured |
| 6 | from django.db import connection |
6 | 7 | from django.test import TestCase |
7 | 8 | from django.test.utils import override_settings |
8 | | from django.utils import timezone |
| 9 | from django.utils import timezone, unittest |
9 | 10 | |
10 | 11 | from .models import Book, BookSigning |
11 | 12 | |
… |
… |
class ArchiveIndexViewTests(TestCase):
|
95 | 96 | res = self.client.get('/dates/booksignings/') |
96 | 97 | self.assertEqual(res.status_code, 200) |
97 | 98 | |
| 99 | @unittest.skipIf(not connection.features.supports_timezones, |
| 100 | "Database backend does not support timezones") |
98 | 101 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
99 | 102 | def test_aware_datetime_archive_view(self): |
100 | 103 | BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0, tzinfo=timezone.utc)) |
… |
… |
class YearArchiveViewTests(TestCase):
|
160 | 163 | res = self.client.get('/dates/booksignings/2008/') |
161 | 164 | self.assertEqual(res.status_code, 200) |
162 | 165 | |
| 166 | @unittest.skipIf(not connection.features.supports_timezones, |
| 167 | "Database backend does not support timezones") |
163 | 168 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
164 | 169 | def test_aware_datetime_year_view(self): |
165 | 170 | BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0, tzinfo=timezone.utc)) |
… |
… |
class MonthArchiveViewTests(TestCase):
|
278 | 283 | res = self.client.get('/dates/booksignings/2008/apr/') |
279 | 284 | self.assertEqual(res.status_code, 200) |
280 | 285 | |
| 286 | @unittest.skipIf(not connection.features.supports_timezones, |
| 287 | "Database backend does not support timezones") |
281 | 288 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
282 | 289 | def test_aware_datetime_month_view(self): |
283 | 290 | BookSigning.objects.create(event_date=datetime.datetime(2008, 2, 1, 12, 0, tzinfo=timezone.utc)) |
… |
… |
class WeekArchiveViewTests(TestCase):
|
377 | 384 | res = self.client.get('/dates/booksignings/2008/week/13/') |
378 | 385 | self.assertEqual(res.status_code, 200) |
379 | 386 | |
| 387 | @unittest.skipIf(not connection.features.supports_timezones, |
| 388 | "Database backend does not support timezones") |
380 | 389 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
381 | 390 | def test_aware_datetime_week_view(self): |
382 | 391 | BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0, tzinfo=timezone.utc)) |
… |
… |
class DayArchiveViewTests(TestCase):
|
477 | 486 | res = self.client.get('/dates/booksignings/2008/apr/2/') |
478 | 487 | self.assertEqual(res.status_code, 200) |
479 | 488 | |
| 489 | @unittest.skipIf(not connection.features.supports_timezones, |
| 490 | "Database backend does not support timezones") |
480 | 491 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
481 | 492 | def test_aware_datetime_day_view(self): |
482 | 493 | bs = BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0, tzinfo=timezone.utc)) |
… |
… |
class DateDetailViewTests(TestCase):
|
553 | 564 | res = self.client.get('/dates/booksignings/2008/apr/2/%d/' % bs.pk) |
554 | 565 | self.assertEqual(res.status_code, 200) |
555 | 566 | |
| 567 | @unittest.skipIf(not connection.features.supports_timezones, |
| 568 | "Database backend does not support timezones") |
556 | 569 | @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi') |
557 | 570 | def test_aware_datetime_date_detail(self): |
558 | 571 | bs = BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0, tzinfo=timezone.utc)) |