Permalink
Browse files

Fixed some breakage with some recent changes.

git-svn-id: https://django-timezones.googlecode.com/svn/trunk@41 86ebb30f-654e-0410-bc0d-7bf82786d749
  • Loading branch information...
1 parent 954aaea commit 5e839d7fcfd2dc82c98068e4d10ebd19e36300fe @brosner committed Dec 11, 2008
Showing with 7 additions and 4 deletions.
  1. +2 −2 timezones/fields.py
  2. +5 −2 timezones/tests.py
View
4 timezones/fields.py
@@ -13,14 +13,14 @@
assert(reduce(lambda x, y: x and (len(y) <= MAX_TIMEZONE_LENGTH),
- forms.TIMEZONE_CHOICES, True),
+ forms.ALL_TIMEZONE_CHOICES, True),
"timezones.fields.TimeZoneField MAX_TIMEZONE_LENGTH is too small")
class TimeZoneField(models.CharField):
def __init__(self, *args, **kwargs):
defaults = {"max_length": MAX_TIMEZONE_LENGTH,
"default": settings.TIME_ZONE,
- "choices": forms.TIMEZONE_CHOICES}
+ "choices": forms.PRETTY_TIMEZONE_CHOICES}
defaults.update(kwargs)
return super(TimeZoneField, self).__init__(*args, **defaults)
View
7 timezones/tests.py
@@ -7,9 +7,12 @@
>>> settings.TIME_ZONE = "UTC"
>>> from timezones import forms, decorators
+>>> from timezones.utils import localtime_for_timezone, adjust_datetime_to_timezone
-# the default case where no timezone is given explicitly.
-# uses settings.TIME_ZONE.
+>>> localtime_for_timezone(datetime(2008, 6, 25, 18, 0, 0), "America/Denver").strftime("%m/%d/%Y %H:%I:%S")
+'06/25/2008 12:12:00'
+
+# the default case where no timezone is given explicitly. uses settings.TIME_ZONE.
>>> f = forms.LocalizedDateTimeField()
>>> f.clean("2008-05-30 14:30:00")
datetime.datetime(2008, 5, 30, 14, 30, tzinfo=<UTC>)

0 comments on commit 5e839d7

Please sign in to comment.