2012-06-07 16:08:47 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2010-12-18 20:32:08 +00:00
|
|
|
from django.contrib.localflavor.kw.forms import KWCivilIDNumberField
|
|
|
|
|
2011-08-23 02:32:37 +00:00
|
|
|
from django.test import SimpleTestCase
|
2010-12-18 20:32:08 +00:00
|
|
|
|
|
|
|
|
2011-08-23 02:32:37 +00:00
|
|
|
class KWLocalFlavorTests(SimpleTestCase):
|
2010-12-18 20:32:08 +00:00
|
|
|
def test_KWCivilIDNumberField(self):
|
2012-06-07 16:08:47 +00:00
|
|
|
error_invalid = ['Enter a valid Kuwaiti Civil ID number']
|
2010-12-18 20:32:08 +00:00
|
|
|
valid = {
|
|
|
|
'282040701483': '282040701483',
|
|
|
|
}
|
|
|
|
invalid = {
|
|
|
|
'289332013455': error_invalid,
|
|
|
|
}
|
|
|
|
self.assertFieldOutput(KWCivilIDNumberField, valid, invalid)
|