Ticket #18794: failing_test.txt

File failing_test.txt, 1.0 KB (added by void, 3 years ago)

Failing test

Line 
1diff --git a/tests/regressiontests/generic_views/dates.py b/tests/regressiontests/generic_views/dates.py
2index c2fa71b..605f4e5 100644
3--- a/tests/regressiontests/generic_views/dates.py
4+++ b/tests/regressiontests/generic_views/dates.py
5@@ -613,3 +613,16 @@ class DateDetailViewTests(TestCase):
6         bs.save()
7         res = self.client.get('/dates/booksignings/2008/apr/2/%d/' % bs.pk)
8         self.assertEqual(res.status_code, 404)
9+       
10+    @requires_tz_support
11+    @override_settings(USE_TZ=True, TIME_ZONE='Europe/London')
12+    def test_ticket18794(self):
13+        bs = BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 22, 0, tzinfo=timezone.utc))
14+        bs_url = '/dates/booksignings/2008/apr/2/%d/' % bs.pk
15+        with timezone.override('Europe/London'):
16+            res = self.client.get(bs_url)
17+            self.assertEqual(res.status_code, 200)
18+       
19+        with timezone.override('Africa/Nairobi'):
20+            res = self.client.get(bs_url)
21+            self.assertEqual(res.status_code, 200)
Back to Top