File do-not-fail-on-day-one-of-month.patch of Package python-django-request
Index: django-request-1.7.0/tests/test_managers.py
===================================================================
--- django-request-1.7.0.orig/tests/test_managers.py
+++ django-request-1.7.0/tests/test_managers.py
@@ -68,6 +68,7 @@ class RequestQuerySetTest(TestCase):
qs = Request.objects.all().year(self.request.time.year + 1)
self.assertEqual(qs.count(), 0)
+ @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi')
def test_month(self):
qs = Request.objects.all().month(year=None, month=None, date=now())
self.assertEqual(qs.count(), 1)
@@ -80,6 +81,7 @@ class RequestQuerySetTest(TestCase):
)
self.assertEqual(qs.count(), 0)
+ @override_settings(USE_TZ=True, TIME_ZONE='Africa/Nairobi')
def test_month_without_date(self):
now_month = now().strftime("%b")
qs = Request.objects.all().month(
@@ -103,7 +105,7 @@ class RequestQuerySetTest(TestCase):
def test_month_is_december(self):
# setUp
- december_time = now().replace(month=12)
+ december_time = now().replace(month=12, day=15)
self.request.time = december_time
self.request.save()
# Test
@@ -112,7 +114,7 @@ class RequestQuerySetTest(TestCase):
def test_month_is_not_december(self):
# setUp
- november_time = now().replace(month=11)
+ november_time = now().replace(month=11, day=15)
self.request.time = november_time
self.request.save()
# Test