Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 5787603c8b9753b5afa6739ee4654105eb877657 1 parent 64073e4
Malcolm Tredinnick malcolmt authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/regressiontests/forms/tests.py
18 tests/regressiontests/forms/tests.py
View
@@ -3878,6 +3878,24 @@
<option value="okinawa">Okinawa</option>
</select>
+# 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'<select name="regions">\n<option value="ABR">Abruzzo</option>\n<option value="BAS">Basilicata</option>\n<option value="CAL">Calabria</option>\n<option value="CAM">Campania</option>\n<option value="EMR">Emilia-Romagna</option>\n<option value="FVG">Friuli-Venezia Giulia</option>\n<option value="LAZ">Lazio</option>\n<option value="LIG">Liguria</option>\n<option value="LOM">Lombardia</option>\n<option value="MAR">Marche</option>\n<option value="MOL">Molise</option>\n<option value="PMN" selected="selected">Piemonte</option>\n<option value="PUG">Puglia</option>\n<option value="SAR">Sardegna</option>\n<option value="SIC">Sicilia</option>\n<option value="TOS">Toscana</option>\n<option value="TAA">Trentino-Alto Adige</option>\n<option value="UMB">Umbria</option>\n<option value="VAO">Valle d\u2019Aosta</option>\n<option value="VEN">Veneto</option>\n</select>'
+
# FIZipCodeField #############################################################
FIZipCodeField validates that the data is a valid FI zipcode.
Please sign in to comment.
Something went wrong with that request. Please try again.