Commit 58bcb7d1 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

Caught (and tested) the warning added at r17393 in the corresponding test. Refs #17580.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17403 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 6b16580a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -264,7 +264,12 @@ class NewDatabaseTests(BaseDateTimeTests):
    @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=dt)
            self.assertEqual(len(recorded), 1)
            msg = str(recorded[0].message)
            self.assertTrue(msg.startswith("DateTimeField received a naive datetime"))
        event = Event.objects.get()
        self.assertEqual(event.dt, datetime.datetime(2011, 9, 1, tzinfo=EAT))