Fixed #17139 -- Corrected the French department names to contain accents.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2aae057727
commit
d6f9c1e774
|
@ -5,7 +5,7 @@ from __future__ import absolute_import
|
|||
|
||||
import re
|
||||
|
||||
from django.contrib.localflavor.fr.fr_department import DEPARTMENT_ASCII_CHOICES
|
||||
from django.contrib.localflavor.fr.fr_department import DEPARTMENT_CHOICES
|
||||
from django.core.validators import EMPTY_VALUES
|
||||
from django.forms import ValidationError
|
||||
from django.forms.fields import Field, RegexField, Select
|
||||
|
@ -50,5 +50,5 @@ class FRDepartmentSelect(Select):
|
|||
A Select widget that uses a list of FR departments as its choices.
|
||||
"""
|
||||
def __init__(self, attrs=None):
|
||||
super(FRDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_ASCII_CHOICES)
|
||||
super(FRDepartmentSelect, self).__init__(attrs, choices=DEPARTMENT_CHOICES)
|
||||
|
||||
|
|
|
@ -1,110 +1,110 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
DEPARTMENT_ASCII_CHOICES = (
|
||||
('01', '01 - Ain'),
|
||||
('02', '02 - Aisne'),
|
||||
('03', '03 - Allier'),
|
||||
('04', '04 - Alpes-de-Haute-Provence'),
|
||||
('05', '05 - Hautes-Alpes'),
|
||||
('06', '06 - Alpes-Maritimes'),
|
||||
('07', '07 - Ardeche'),
|
||||
('08', '08 - Ardennes'),
|
||||
('09', '09 - Ariege'),
|
||||
('10', '10 - Aube'),
|
||||
('11', '11 - Aude'),
|
||||
('12', '12 - Aveyron'),
|
||||
('13', '13 - Bouches-du-Rhone'),
|
||||
('14', '14 - Calvados'),
|
||||
('15', '15 - Cantal'),
|
||||
('16', '16 - Charente'),
|
||||
('17', '17 - Charente-Maritime'),
|
||||
('18', '18 - Cher'),
|
||||
('19', '19 - Correze'),
|
||||
('21', '21 - Cote-d\'Or'),
|
||||
('22', '22 - Cotes-d\'Armor'),
|
||||
('23', '23 - Creuse'),
|
||||
('24', '24 - Dordogne'),
|
||||
('25', '25 - Doubs'),
|
||||
('26', '26 - Drome'),
|
||||
('27', '27 - Eure'),
|
||||
('28', '28 - Eure-et-Loire'),
|
||||
('29', '29 - Finistere'),
|
||||
('2A', '2A - Corse-du-Sud'),
|
||||
('2B', '2B - Haute-Corse'),
|
||||
('30', '30 - Gard'),
|
||||
('31', '31 - Haute-Garonne'),
|
||||
('32', '32 - Gers'),
|
||||
('33', '33 - Gironde'),
|
||||
('34', '34 - Herault'),
|
||||
('35', '35 - Ille-et-Vilaine'),
|
||||
('36', '36 - Indre'),
|
||||
('37', '37 - Indre-et-Loire'),
|
||||
('38', '38 - Isere'),
|
||||
('39', '39 - Jura'),
|
||||
('40', '40 - Landes'),
|
||||
('41', '41 - Loir-et-Cher'),
|
||||
('42', '42 - Loire'),
|
||||
('43', '43 - Haute-Loire'),
|
||||
('44', '44 - Loire-Atlantique'),
|
||||
('45', '45 - Loiret'),
|
||||
('46', '46 - Lot'),
|
||||
('47', '47 - Lot-et-Garonne'),
|
||||
('48', '48 - Lozere'),
|
||||
('49', '49 - Maine-et-Loire'),
|
||||
('50', '50 - Manche'),
|
||||
('51', '51 - Marne'),
|
||||
('52', '52 - Haute-Marne'),
|
||||
('53', '53 - Mayenne'),
|
||||
('54', '54 - Meurthe-et-Moselle'),
|
||||
('55', '55 - Meuse'),
|
||||
('56', '56 - Morbihan'),
|
||||
('57', '57 - Moselle'),
|
||||
('58', '58 - Nievre'),
|
||||
('59', '59 - Nord'),
|
||||
('60', '60 - Oise'),
|
||||
('61', '61 - Orne'),
|
||||
('62', '62 - Pas-de-Calais'),
|
||||
('63', '63 - Puy-de-Dome'),
|
||||
('64', '64 - Pyrenees-Atlantiques'),
|
||||
('65', '65 - Hautes-Pyrenees'),
|
||||
('66', '66 - Pyrenees-Orientales'),
|
||||
('67', '67 - Bas-Rhin'),
|
||||
('68', '68 - Haut-Rhin'),
|
||||
('69', '69 - Rhone'),
|
||||
('70', '70 - Haute-Saone'),
|
||||
('71', '71 - Saone-et-Loire'),
|
||||
('72', '72 - Sarthe'),
|
||||
('73', '73 - Savoie'),
|
||||
('74', '74 - Haute-Savoie'),
|
||||
('75', '75 - Paris'),
|
||||
('76', '76 - Seine-Maritime'),
|
||||
('77', '77 - Seine-et-Marne'),
|
||||
('78', '78 - Yvelines'),
|
||||
('79', '79 - Deux-Sevres'),
|
||||
('80', '80 - Somme'),
|
||||
('81', '81 - Tarn'),
|
||||
('82', '82 - Tarn-et-Garonne'),
|
||||
('83', '83 - Var'),
|
||||
('84', '84 - Vaucluse'),
|
||||
('85', '85 - Vendee'),
|
||||
('86', '86 - Vienne'),
|
||||
('87', '87 - Haute-Vienne'),
|
||||
('88', '88 - Vosges'),
|
||||
('89', '89 - Yonne'),
|
||||
('90', '90 - Territoire de Belfort'),
|
||||
('91', '91 - Essonne'),
|
||||
('92', '92 - Hauts-de-Seine'),
|
||||
('93', '93 - Seine-Saint-Denis'),
|
||||
('94', '94 - Val-de-Marne'),
|
||||
('95', '95 - Val-d\'Oise'),
|
||||
('971', '971 - Guadeloupe'),
|
||||
('972', '972 - Martinique'),
|
||||
('973', '973 - Guyane'),
|
||||
('974', '974 - La Reunion'),
|
||||
('975', '975 - Saint-Pierre-et-Miquelon'),
|
||||
('976', '976 - Mayotte'),
|
||||
('984', '984 - Terres Australes et Antarctiques'),
|
||||
('986', '986 - Wallis et Futuna'),
|
||||
('987', '987 - Polynesie Francaise'),
|
||||
('988', '988 - Nouvelle-Caledonie'),
|
||||
DEPARTMENT_CHOICES = (
|
||||
('01', u'01 - Ain'),
|
||||
('02', u'02 - Aisne'),
|
||||
('03', u'03 - Allier'),
|
||||
('04', u'04 - Alpes-de-Haute-Provence'),
|
||||
('05', u'05 - Hautes-Alpes'),
|
||||
('06', u'06 - Alpes-Maritimes'),
|
||||
('07', u'07 - Ardèche'),
|
||||
('08', u'08 - Ardennes'),
|
||||
('09', u'09 - Ariège'),
|
||||
('10', u'10 - Aube'),
|
||||
('11', u'11 - Aude'),
|
||||
('12', u'12 - Aveyron'),
|
||||
('13', u'13 - Bouches-du-Rhône'),
|
||||
('14', u'14 - Calvados'),
|
||||
('15', u'15 - Cantal'),
|
||||
('16', u'16 - Charente'),
|
||||
('17', u'17 - Charente-Maritime'),
|
||||
('18', u'18 - Cher'),
|
||||
('19', u'19 - Corrèze'),
|
||||
('21', u'21 - Côte-d\'Or'),
|
||||
('22', u'22 - Côtes-d\'Armor'),
|
||||
('23', u'23 - Creuse'),
|
||||
('24', u'24 - Dordogne'),
|
||||
('25', u'25 - Doubs'),
|
||||
('26', u'26 - Drôme'),
|
||||
('27', u'27 - Eure'),
|
||||
('28', u'28 - Eure-et-Loire'),
|
||||
('29', u'29 - Finistère'),
|
||||
('2A', u'2A - Corse-du-Sud'),
|
||||
('2B', u'2B - Haute-Corse'),
|
||||
('30', u'30 - Gard'),
|
||||
('31', u'31 - Haute-Garonne'),
|
||||
('32', u'32 - Gers'),
|
||||
('33', u'33 - Gironde'),
|
||||
('34', u'34 - Hérault'),
|
||||
('35', u'35 - Ille-et-Vilaine'),
|
||||
('36', u'36 - Indre'),
|
||||
('37', u'37 - Indre-et-Loire'),
|
||||
('38', u'38 - Isère'),
|
||||
('39', u'39 - Jura'),
|
||||
('40', u'40 - Landes'),
|
||||
('41', u'41 - Loir-et-Cher'),
|
||||
('42', u'42 - Loire'),
|
||||
('43', u'43 - Haute-Loire'),
|
||||
('44', u'44 - Loire-Atlantique'),
|
||||
('45', u'45 - Loiret'),
|
||||
('46', u'46 - Lot'),
|
||||
('47', u'47 - Lot-et-Garonne'),
|
||||
('48', u'48 - Lozère'),
|
||||
('49', u'49 - Maine-et-Loire'),
|
||||
('50', u'50 - Manche'),
|
||||
('51', u'51 - Marne'),
|
||||
('52', u'52 - Haute-Marne'),
|
||||
('53', u'53 - Mayenne'),
|
||||
('54', u'54 - Meurthe-et-Moselle'),
|
||||
('55', u'55 - Meuse'),
|
||||
('56', u'56 - Morbihan'),
|
||||
('57', u'57 - Moselle'),
|
||||
('58', u'58 - Nièvre'),
|
||||
('59', u'59 - Nord'),
|
||||
('60', u'60 - Oise'),
|
||||
('61', u'61 - Orne'),
|
||||
('62', u'62 - Pas-de-Calais'),
|
||||
('63', u'63 - Puy-de-Dôme'),
|
||||
('64', u'64 - Pyrénées-Atlantiques'),
|
||||
('65', u'65 - Hautes-Pyrénées'),
|
||||
('66', u'66 - Pyrénées-Orientales'),
|
||||
('67', u'67 - Bas-Rhin'),
|
||||
('68', u'68 - Haut-Rhin'),
|
||||
('69', u'69 - Rhône'),
|
||||
('70', u'70 - Haute-Saône'),
|
||||
('71', u'71 - Saône-et-Loire'),
|
||||
('72', u'72 - Sarthe'),
|
||||
('73', u'73 - Savoie'),
|
||||
('74', u'74 - Haute-Savoie'),
|
||||
('75', u'75 - Paris'),
|
||||
('76', u'76 - Seine-Maritime'),
|
||||
('77', u'77 - Seine-et-Marne'),
|
||||
('78', u'78 - Yvelines'),
|
||||
('79', u'79 - Deux-Sèvres'),
|
||||
('80', u'80 - Somme'),
|
||||
('81', u'81 - Tarn'),
|
||||
('82', u'82 - Tarn-et-Garonne'),
|
||||
('83', u'83 - Var'),
|
||||
('84', u'84 - Vaucluse'),
|
||||
('85', u'85 - Vendée'),
|
||||
('86', u'86 - Vienne'),
|
||||
('87', u'87 - Haute-Vienne'),
|
||||
('88', u'88 - Vosges'),
|
||||
('89', u'89 - Yonne'),
|
||||
('90', u'90 - Territoire de Belfort'),
|
||||
('91', u'91 - Essonne'),
|
||||
('92', u'92 - Hauts-de-Seine'),
|
||||
('93', u'93 - Seine-Saint-Denis'),
|
||||
('94', u'94 - Val-de-Marne'),
|
||||
('95', u'95 - Val-d\'Oise'),
|
||||
('971', u'971 - Guadeloupe'),
|
||||
('972', u'972 - Martinique'),
|
||||
('973', u'973 - Guyane'),
|
||||
('974', u'974 - La Réunion'),
|
||||
('975', u'975 - Saint-Pierre-et-Miquelon'),
|
||||
('976', u'976 - Mayotte'),
|
||||
('984', u'984 - Terres Australes et Antarctiques'),
|
||||
('986', u'986 - Wallis et Futuna'),
|
||||
('987', u'987 - Polynésie Française'),
|
||||
('988', u'988 - Nouvelle-Calédonie'),
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.contrib.localflavor.fr.forms import (FRZipCodeField,
|
||||
FRPhoneNumberField, FRDepartmentSelect)
|
||||
|
||||
|
@ -41,39 +42,39 @@ class FRLocalFlavorTests(SimpleTestCase):
|
|||
<option value="04">04 - Alpes-de-Haute-Provence</option>
|
||||
<option value="05">05 - Hautes-Alpes</option>
|
||||
<option value="06">06 - Alpes-Maritimes</option>
|
||||
<option value="07">07 - Ardeche</option>
|
||||
<option value="07">07 - Ardèche</option>
|
||||
<option value="08">08 - Ardennes</option>
|
||||
<option value="09">09 - Ariege</option>
|
||||
<option value="09">09 - Ariège</option>
|
||||
<option value="10">10 - Aube</option>
|
||||
<option value="11">11 - Aude</option>
|
||||
<option value="12">12 - Aveyron</option>
|
||||
<option value="13">13 - Bouches-du-Rhone</option>
|
||||
<option value="13">13 - Bouches-du-Rhône</option>
|
||||
<option value="14">14 - Calvados</option>
|
||||
<option value="15">15 - Cantal</option>
|
||||
<option value="16">16 - Charente</option>
|
||||
<option value="17">17 - Charente-Maritime</option>
|
||||
<option value="18">18 - Cher</option>
|
||||
<option value="19">19 - Correze</option>
|
||||
<option value="21">21 - Cote-d'Or</option>
|
||||
<option value="22">22 - Cotes-d'Armor</option>
|
||||
<option value="19">19 - Corrèze</option>
|
||||
<option value="21">21 - Côte-d'Or</option>
|
||||
<option value="22">22 - Côtes-d'Armor</option>
|
||||
<option value="23">23 - Creuse</option>
|
||||
<option value="24">24 - Dordogne</option>
|
||||
<option value="25">25 - Doubs</option>
|
||||
<option value="26">26 - Drome</option>
|
||||
<option value="26">26 - Drôme</option>
|
||||
<option value="27">27 - Eure</option>
|
||||
<option value="28">28 - Eure-et-Loire</option>
|
||||
<option value="29">29 - Finistere</option>
|
||||
<option value="29">29 - Finistère</option>
|
||||
<option value="2A">2A - Corse-du-Sud</option>
|
||||
<option value="2B">2B - Haute-Corse</option>
|
||||
<option value="30">30 - Gard</option>
|
||||
<option value="31">31 - Haute-Garonne</option>
|
||||
<option value="32">32 - Gers</option>
|
||||
<option value="33">33 - Gironde</option>
|
||||
<option value="34">34 - Herault</option>
|
||||
<option value="34">34 - Hérault</option>
|
||||
<option value="35">35 - Ille-et-Vilaine</option>
|
||||
<option value="36">36 - Indre</option>
|
||||
<option value="37">37 - Indre-et-Loire</option>
|
||||
<option value="38">38 - Isere</option>
|
||||
<option value="38">38 - Isère</option>
|
||||
<option value="39">39 - Jura</option>
|
||||
<option value="40">40 - Landes</option>
|
||||
<option value="41">41 - Loir-et-Cher</option>
|
||||
|
@ -83,7 +84,7 @@ class FRLocalFlavorTests(SimpleTestCase):
|
|||
<option value="45">45 - Loiret</option>
|
||||
<option value="46">46 - Lot</option>
|
||||
<option value="47">47 - Lot-et-Garonne</option>
|
||||
<option value="48">48 - Lozere</option>
|
||||
<option value="48">48 - Lozère</option>
|
||||
<option value="49">49 - Maine-et-Loire</option>
|
||||
<option value="50">50 - Manche</option>
|
||||
<option value="51">51 - Marne</option>
|
||||
|
@ -93,20 +94,20 @@ class FRLocalFlavorTests(SimpleTestCase):
|
|||
<option value="55">55 - Meuse</option>
|
||||
<option value="56">56 - Morbihan</option>
|
||||
<option value="57">57 - Moselle</option>
|
||||
<option value="58">58 - Nievre</option>
|
||||
<option value="58">58 - Nièvre</option>
|
||||
<option value="59">59 - Nord</option>
|
||||
<option value="60">60 - Oise</option>
|
||||
<option value="61">61 - Orne</option>
|
||||
<option value="62">62 - Pas-de-Calais</option>
|
||||
<option value="63">63 - Puy-de-Dome</option>
|
||||
<option value="64">64 - Pyrenees-Atlantiques</option>
|
||||
<option value="65">65 - Hautes-Pyrenees</option>
|
||||
<option value="66">66 - Pyrenees-Orientales</option>
|
||||
<option value="63">63 - Puy-de-Dôme</option>
|
||||
<option value="64">64 - Pyrénées-Atlantiques</option>
|
||||
<option value="65">65 - Hautes-Pyrénées</option>
|
||||
<option value="66">66 - Pyrénées-Orientales</option>
|
||||
<option value="67">67 - Bas-Rhin</option>
|
||||
<option value="68">68 - Haut-Rhin</option>
|
||||
<option value="69">69 - Rhone</option>
|
||||
<option value="70">70 - Haute-Saone</option>
|
||||
<option value="71">71 - Saone-et-Loire</option>
|
||||
<option value="69">69 - Rhône</option>
|
||||
<option value="70">70 - Haute-Saône</option>
|
||||
<option value="71">71 - Saône-et-Loire</option>
|
||||
<option value="72">72 - Sarthe</option>
|
||||
<option value="73">73 - Savoie</option>
|
||||
<option value="74">74 - Haute-Savoie</option>
|
||||
|
@ -114,13 +115,13 @@ class FRLocalFlavorTests(SimpleTestCase):
|
|||
<option value="76">76 - Seine-Maritime</option>
|
||||
<option value="77">77 - Seine-et-Marne</option>
|
||||
<option value="78">78 - Yvelines</option>
|
||||
<option value="79">79 - Deux-Sevres</option>
|
||||
<option value="79">79 - Deux-Sèvres</option>
|
||||
<option value="80">80 - Somme</option>
|
||||
<option value="81">81 - Tarn</option>
|
||||
<option value="82">82 - Tarn-et-Garonne</option>
|
||||
<option value="83">83 - Var</option>
|
||||
<option value="84">84 - Vaucluse</option>
|
||||
<option value="85">85 - Vendee</option>
|
||||
<option value="85">85 - Vendée</option>
|
||||
<option value="86">86 - Vienne</option>
|
||||
<option value="87">87 - Haute-Vienne</option>
|
||||
<option value="88">88 - Vosges</option>
|
||||
|
@ -134,12 +135,12 @@ class FRLocalFlavorTests(SimpleTestCase):
|
|||
<option value="971">971 - Guadeloupe</option>
|
||||
<option value="972">972 - Martinique</option>
|
||||
<option value="973">973 - Guyane</option>
|
||||
<option value="974">974 - La Reunion</option>
|
||||
<option value="974">974 - La Réunion</option>
|
||||
<option value="975">975 - Saint-Pierre-et-Miquelon</option>
|
||||
<option value="976">976 - Mayotte</option>
|
||||
<option value="984">984 - Terres Australes et Antarctiques</option>
|
||||
<option value="986">986 - Wallis et Futuna</option>
|
||||
<option value="987">987 - Polynesie Francaise</option>
|
||||
<option value="988">988 - Nouvelle-Caledonie</option>
|
||||
<option value="987">987 - Polynésie Française</option>
|
||||
<option value="988">988 - Nouvelle-Calédonie</option>
|
||||
</select>'''
|
||||
self.assertHTMLEqual(f.render('dep', 'Paris'), out)
|
||||
|
|
Loading…
Reference in New Issue