From 5188a18dbed4182a602b540e7ce47eb781b0c704 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 14 Sep 2007 07:19:38 +0000 Subject: Fixed #4964 -- Added Brazilian state field to localflavors. Thanks, William Alves de Souza. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6176 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/forms/localflavor.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/regressiontests/forms') diff --git a/tests/regressiontests/forms/localflavor.py b/tests/regressiontests/forms/localflavor.py index 01c6df8e76..1d46adfc0b 100644 --- a/tests/regressiontests/forms/localflavor.py +++ b/tests/regressiontests/forms/localflavor.py @@ -980,6 +980,20 @@ u'41-3562-3464' >>> w.render('states', 'PR') u'' +# BRStateChoiceField ######################################################### +>>> from django.contrib.localflavor.br.forms import BRStateChoiceField +>>> f = BRStateChoiceField() +>>> ', '.join([f.clean(s) for s, _ in f.widget.choices]) +u'AC, AL, AP, AM, BA, CE, DF, ES, GO, MA, MT, MS, MG, PA, PB, PR, PE, PI, RJ, RN, RS, RO, RR, SC, SP, SE, TO' +>>> f.clean('') +Traceback (most recent call last): +... +ValidationError: [u'This field is required.'] +>>> f.clean('pr') +Traceback (most recent call last): +... +ValidationError: [u'Select a valid brazilian state. That state is not one of the available states.'] + # DEZipCodeField ############################################################## >>> from django.contrib.localflavor.de.forms import DEZipCodeField -- cgit v1.3