Django

Code

Show
Ignore:
Timestamp:
09/01/08 12:48:39 (3 months ago)
Author:
jacob
Message:

Fixed #8354: the MySQL backend no longer raises a cryptic error. Instead, it raises a less-cryptic error. Obiously this isn't a perfect solution by any means, but it'll do until we can revisit timezone handling in the future.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/datatypes/models.py

    r8801 r8802  
    8484 
    8585"""} 
     86 
     87# Regression test for #8354: the MySQL backend should raise an error if given 
     88# a timezone-aware datetime object. 
     89if settings.DATABASE_ENGINE == 'mysql': 
     90    __test__['API_TESTS'] += """ 
     91>>> from django.utils import tzinfo  
     92>>> dt = datetime.datetime(2008, 8, 31, 16, 20, tzinfo=tzinfo.FixedOffset(0))  
     93>>> d = Donut(name='Bear claw', consumed_at=dt)  
     94>>> d.save() 
     95Traceback (most recent call last): 
     96    .... 
     97ValueError: MySQL backend does not support timezone-aware datetimes. 
     98"""