Added extra assertion to migrations.test_writer.WriterTests.test_serialize_datetime.
This checks that datetime.timezone.utc serializes correctly.
@@ -492,8 +492,10 @@ class WriterTests(SimpleTestCase):
datetime.datetime(2014, 1, 1, 1, 1),
("datetime.datetime(2014, 1, 1, 1, 1)", {'import datetime'})
)
+ for tzinfo in (utc, datetime.timezone.utc):
+ with self.subTest(tzinfo=tzinfo):
self.assertSerializedResultEqual(
- datetime.datetime(2012, 1, 1, 1, 1, tzinfo=utc),
+ datetime.datetime(2012, 1, 1, 1, 1, tzinfo=tzinfo),
(
"datetime.datetime(2012, 1, 1, 1, 1, tzinfo=utc)",
{'import datetime', 'from django.utils.timezone import utc'},
