You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tz_offset is not reflected on django's timezone correctly.
import datetime
from django.test import TestCase
from django.utils import timezone
from freezegun import freeze_time
class SomeTests(TestCase):
@freeze_time('2019-04-01 00:00:00', tz_offset=9)
def test_all_published_default(self):
print(timezone.now())
print(datetime.datetime.now())
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.....2019-04-01 00:00:00+00:00
2019-04-01 09:00:00
.......
----------------------------------------------------------------------
Ran 12 tests in 0.710s
OK
Destroying test database for alias 'default'...
The text was updated successfully, but these errors were encountered:
I uderstand the issue and kinda see what is happening, but I have no clue if there's a workaround to this. Yeah, sure I could write the time in UTC, but I think it would hinder the readability of my tests. Am I missing something?
Python 3.7
freezegun 0.3.11
Django 2.1
tz_offset is not reflected on django's timezone correctly.
The text was updated successfully, but these errors were encountered: