From 5787603c8b9753b5afa6739ee4654105eb877657 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 31 Mar 2007 09:18:20 +0000 Subject: [PATCH] Fixed #3866 -- Added tests for localflavor/it. Thanks flavio.curella@gmail.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@4876 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/tests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 7f9f7fcbefa..a093e30ed8d 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -3878,6 +3878,24 @@ A Select widget that uses a list of Japanese prefectures as its choices. +# ITZipCodeField ############################################################# + +>>> from django.contrib.localflavor.it.forms import ITZipCodeField +>>> f = ITZipCodeField() +>>> f.clean('00100') +u'00100' +>>> f.clean(' 00100') +Traceback (most recent call last): +... +ValidationError: [u'Enter a zip code in the format XXXXX.'] + +# ITRegionSelect ############################################################# + +>>> from django.contrib.localflavor.it.forms import ITRegionSelect +>>> w = ITRegionSelect() +>>> w.render('regions', 'PMN') +u'' + # FIZipCodeField ############################################################# FIZipCodeField validates that the data is a valid FI zipcode.