summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-01-01 21:32:24 +0000
committerJannis Leidel <jannis@leidel.info>2010-01-01 21:32:24 +0000
commit82b33b1d805a5565c2d8aed21340bc56c0a12679 (patch)
treed58170cb5cf3098720ba209ea23e336429bc1df9 /tests/regressiontests/forms
parent3825bb2350d9547622a9d1201ced9743e21783ee (diff)
Fixed #8068 - Added Kuwaiti (kw) localflavor. Thanks to Ahmad Al-Ibrahim for providing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/forms')
-rw-r--r--tests/regressiontests/forms/localflavor/kw.py15
-rw-r--r--tests/regressiontests/forms/tests.py2
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/regressiontests/forms/localflavor/kw.py b/tests/regressiontests/forms/localflavor/kw.py
new file mode 100644
index 0000000000..265c1f00ae
--- /dev/null
+++ b/tests/regressiontests/forms/localflavor/kw.py
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+# Tests for the contrib/localflavor/ KW form fields.
+
+tests = r"""
+# KWCivilIDNumberField ########################################################
+
+>>> from django.contrib.localflavor.kw.forms import KWCivilIDNumberField
+>>> f = KWCivilIDNumberField()
+>>> f.clean('282040701483')
+'282040701483'
+>>> f.clean('289332013455')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Kuwaiti Civil ID number']
+"""
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index 0c70cf49aa..bc30e3c82e 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -18,6 +18,7 @@ from localflavor.generic import tests as localflavor_generic_tests
from localflavor.is_ import tests as localflavor_is_tests
from localflavor.it import tests as localflavor_it_tests
from localflavor.jp import tests as localflavor_jp_tests
+from localflavor.kw import tests as localflavor_kw_tests
from localflavor.nl import tests as localflavor_nl_tests
from localflavor.pl import tests as localflavor_pl_tests
from localflavor.ro import tests as localflavor_ro_tests
@@ -55,6 +56,7 @@ __test__ = {
'localflavor_is_tests': localflavor_is_tests,
'localflavor_it_tests': localflavor_it_tests,
'localflavor_jp_tests': localflavor_jp_tests,
+ 'localflavor_kw_tests': localflavor_kw_tests,
'localflavor_nl_tests': localflavor_nl_tests,
'localflavor_pl_tests': localflavor_pl_tests,
'localflavor_ro_tests': localflavor_ro_tests,