summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms
diff options
context:
space:
mode:
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,