Skip to content

Commit

Permalink
Update a few tests to use UTC instead of no TZ
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan P Kilby committed Jan 16, 2018
1 parent a88c2bc commit 0e9caa9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/test_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -1642,13 +1642,11 @@ class Meta:
self.assertQuerysetEqual(f.qs, [2], lambda o: o.pk)


# use naive datetimes, as pytz is required to perform
# date lookups when timezones are involved.
@override_settings(USE_TZ=False)
@override_settings(TIME_ZONE='UTC')
class TransformedQueryExpressionFilterTests(TestCase):

def test_filtering(self):
now_dt = datetime.datetime.now()
now_dt = now()
after_5pm = now_dt.replace(hour=18)
before_5pm = now_dt.replace(hour=16)

Expand All @@ -1667,9 +1665,7 @@ class Meta:
self.assertQuerysetEqual(f.qs, [a.pk], lambda o: o.pk)


# use naive datetimes, as pytz is required to perform
# date lookups when timezones are involved.
@override_settings(USE_TZ=False)
@override_settings(TIME_ZONE='UTC')
class CSVFilterTests(TestCase):

def setUp(self):
Expand All @@ -1678,7 +1674,7 @@ def setUp(self):
User.objects.create(username='aaron', status=2)
User.objects.create(username='carl', status=0)

now_dt = datetime.datetime.now()
now_dt = now()
after_5pm = now_dt.replace(hour=18)
before_5pm = now_dt.replace(hour=16)

Expand Down

0 comments on commit 0e9caa9

Please sign in to comment.