Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 87 by
tedche...@gmail.com: No timezone support for MySQL
https://code.google.com/p/django-jython/issues/detail?id=87
What steps will reproduce the problem?
1. A model with datetime field
2. Django settings has USE_TZ = True
3. Save the object with a time-zone aware datetime into the MySQL database
3. Retrieve the object from the MySQL database.
The following testcase fails (added to tests.py, and after changing the
test database to use mysql)
from django.utils import timezone
from django.conf import settings
def test_datetime(self):
test_model = TestModel(field_4 = 'abc', field_6 = timezone.now())
test_model.save()
self.assertEqual(TestModel.objects.filter(field_4='abc').count(), 1)
obj = TestModel.objects.filter(field_4='abc')[0]
if settings.USE_TZ:
self.assertTrue(timezone.is_aware(obj.field_6))
else:
self.assertFalse(timezone.is_aware(obj.field_6))
What is the expected output? What do you see instead?
Expected a time-zone aware datetime object, but got a naive one instead.
What version of the product are you using? On what operating system?
django-jython: 1.7.0b2
jython: 2.7b4
django: 1.7.3
OS: Linux
Please provide any additional information below.
SQLite seems to work fine with timezone aware objects, but not MySQL.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings