summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-01-24 10:00:39 +0000
committerJannis Leidel <jannis@leidel.info>2012-01-24 10:00:39 +0000
commit8f168976d68282a6180d2af4e12c4f3b6dd09c85 (patch)
tree28df3f03ba5503faca80436ac9de8ec7ccccf94b /tests
parent6ae393d74db1f8e553c80951f3eaeb3ba16fc223 (diff)
Fixed #17580 -- Made sure datetime.date instances are correctly handled when being passed to a DateTimeField fields and the timezone support is enabled by making it aware using the default timezone.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/timezones/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeltests/timezones/tests.py b/tests/modeltests/timezones/tests.py
index b46aa0ed8c..41c0016240 100644
--- a/tests/modeltests/timezones/tests.py
+++ b/tests/modeltests/timezones/tests.py
@@ -262,6 +262,13 @@ class NewDatabaseTests(BaseDateTimeTests):
self.assertEqual(event.dt, dt.replace(tzinfo=EAT))
@requires_tz_support
+ def test_datetime_from_date(self):
+ dt = datetime.date(2011, 9, 1)
+ Event.objects.create(dt=dt)
+ event = Event.objects.get()
+ self.assertEqual(event.dt, datetime.datetime(2011, 9, 1, tzinfo=EAT))
+
+ @requires_tz_support
@skipIf(sys.version_info < (2, 6), "this test requires Python >= 2.6")
@skipUnlessDBFeature('supports_microsecond_precision')
def test_naive_datetime_with_microsecond(self):