Commits

charettes committed 522ecd3

Make sure `TestOperations.test_datetime_default` works when the timezone support is provided but disabled

Comments (0)

Files changed (1)

south/tests/db.py

+import datetime
 import unittest
 
 from south.db import db, generic
         """
         Test that defaults are created correctly for datetime columns
         """
-        from datetime import datetime
+        end_of_world = datetime.datetime(2012, 12, 21, 0, 0, 1)
 
         try:
             from django.utils import timezone
-            end_of_world = datetime(2012, 12, 21, 0, 0, 1, tzinfo=timezone.utc)
         except ImportError:
-            end_of_world = datetime(2012, 12, 21, 0, 0, 1)
+            pass
+        else:
+            from django.conf import settings
+            if getattr(settings, 'USE_TZ', False):
+                end_of_world = end_of_world.replace(tzinfo=timezone.utc)
 
         db.create_table("test_datetime_def", [
             ('col0', models.IntegerField(null=True)),