

@requires_tz_support
def test_datetime_from_date(self):
    dt = datetime.date(2011, 9, 1)
    with warnings.catch_warnings(record=True) as recorded:
        warnings.simplefilter('always')
        Event.objects.create(dt=msg)
        self.assertEqual(len(recorded), 1)
        msg = str(recorded[0].message)
        self.assertTrue(msg.startswith('DateTimeField Event.dt received a naive datetime'))
    event = Event.objects.get()
    self.assertEqual(event.dt, datetime.datetime(2011, 9, 1, tzinfo=EAT))

dataset/ETHPy150Open django/django/tests/timezones/tests.py NewDatabaseTests.test_datetime_from_date/VarMisuse@55/67 `dt`->`msg`