def test_serialise_with_aware_datetime(self):
        # make an aware datetime, consisting of WAGTAIL_05_RELEASE_DATETIME
        # in a timezone 1hr west of UTC
        one_hour_west = timezone.get_fixed_timezone(-60)

        local_time = timezone.make_aware(self.WAGTAIL_05_RELEASE_DATETIME, one_hour_west)
        log = Log(time=local_time, data="Wagtail 0.5 released")
        log_json = json.loads(log.to_json())

        # Now check that the time is stored correctly with the timezone information at the end
        self.assertEqual(log_json['time'], '2014-08-01T12:01:42Z')
This tests that aware datetimes are converted to as UTC
dataset/ETHPy150Open torchbox/django-modelcluster/tests/tests/test_serialize.py/SerializeTest.test_serialise_with_aware_datetime