-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Labels
Description
While debugging a build failure for openSUSE, I discovered test_day and test_day_without_date failed in tests/test_managers.py due to the timezone falling through to America/Chicago and therefore not matching any records.
Overriding the settings as in other tests in that file fixed the failure:
--- django-request.orig/tests/test_managers.py
+++ django-request/tests/test_managers.py
@@ -134,12 +134,14 @@ class RequestQuerySetTest(TestCase):
qs = Request.objects.all().week(year='foo', week='1')
self.assertIsNone(qs)
+ @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi')
def test_day(self):
qs = Request.objects.all().day(date=now())
self.assertEqual(1, qs.count())
qs = Request.objects.all().day(date=now() - timedelta(days=3))
self.assertEqual(0, qs.count())
+ @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi')
def test_day_without_date(self):
qs = Request.objects.all().day(
year=str(now().year),