From 0ced8b0bb211fca38669293b15316930e0d648fd Mon Sep 17 00:00:00 2001
From: Malcolm Tredinnick
Date: Mon, 25 Jun 2007 12:47:19 +0000
Subject: unicode: Merged from trunk up to [5530]. Oracle backend has not been
ported to support unicode yet.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
---
tests/regressiontests/forms/regressions.py | 2 +-
tests/regressiontests/forms/tests.py | 24 ++++++++++++++++++++----
2 files changed, 21 insertions(+), 5 deletions(-)
(limited to 'tests/regressiontests/forms')
diff --git a/tests/regressiontests/forms/regressions.py b/tests/regressiontests/forms/regressions.py
index 54b9138b20..df2ef578a1 100644
--- a/tests/regressiontests/forms/regressions.py
+++ b/tests/regressiontests/forms/regressions.py
@@ -57,7 +57,7 @@ Translated error messages used to be buggy.
>>> activate('ru')
>>> f = SomeForm({})
>>> f.as_p()
-u'- \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435.
\n
'
+u'- \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435.
\n
'
>>> deactivate()
#######################
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index a2e23b8b42..67d527a08e 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -1859,8 +1859,12 @@ ValidationError: [u'Enter a valid date.']
>>> f = SplitDateTimeField(required=False)
>>> f.clean([datetime.date(2006, 1, 10), datetime.time(7, 30)])
datetime.datetime(2006, 1, 10, 7, 30)
+>>> f.clean(['2006-01-10', '07:30'])
+datetime.datetime(2006, 1, 10, 7, 30)
>>> f.clean(None)
>>> f.clean('')
+>>> f.clean([''])
+>>> f.clean(['', ''])
>>> f.clean('hello')
Traceback (most recent call last):
...
@@ -1877,6 +1881,18 @@ ValidationError: [u'Enter a valid time.']
Traceback (most recent call last):
...
ValidationError: [u'Enter a valid date.']
+>>> f.clean(['2006-01-10', ''])
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid time.']
+>>> f.clean(['2006-01-10'])
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid time.']
+>>> f.clean(['', '07:30'])
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid date.']
#########
# Forms #
@@ -1958,11 +1974,11 @@ AttributeError: 'Person' object has no attribute 'cleaned_data'
>>> print p.as_p()
-
+
-
+
-
+
If you don't pass any values to the Form's __init__(), or if you pass None,
@@ -2668,7 +2684,7 @@ its field's order in the form.
Last name:
Birthday:
>>> print p.as_p()
-- (Hidden field hidden_text) This field is required.
+- (Hidden field hidden_text) This field is required.
First name:
Last name:
Birthday:
--
cgit v1.3