Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update no_municipalities.py to reflect recent changes to norwegian counties #509

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Authors
* Heri Priyatno
* Honza Král
* Horst Gutmann
* Håkon Osland
* Igor Támara
* Illia Volochii
* Ivan Fisun
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Modifications to existing flavors:
- Fix Belarus passport field description punctuation
(`gh-484 <https://github.com/django/django-localflavor/pull/484>`_).
- Change `Kiev` to `Kyiv` 🇺🇦 according to ISO_3166-2:UA
- Update list of Norwegian counties(fylker) `according to changes at the start of 2024 <https://en.wikipedia.org/wiki/Counties_of_Norway#List_of_counties>`_
The changed counties are as follows: austagder and vestagder has been removed and combined into agder. hordaland and sognogfjordane has been removed and combined into vestland. nordtrondelag and sortrondelag has been removed and combined into trondelag. hedmark and oppland has been removed and combined into innlandet
(`gh-509 <https://github.com/django/django-localflavor/pull/509/files>`_).

Other changes:

Expand Down
14 changes: 5 additions & 9 deletions localflavor/no/no_municipalities.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
#: An alphabetical list of Norwegian municipalities (fylker) for
#: use as `choices` in a formfield.
MUNICIPALITY_CHOICES = (
('agder', 'Agder'),
('akershus', 'Akershus'),
('austagder', 'Aust-Agder'),
('buskerud', 'Buskerud'),
('finnmark', 'Finnmark'),
('hedmark', 'Hedmark'),
('hordaland', 'Hordaland'),
('innlandet', 'Innlandet'),
('janmayen', 'Jan Mayen'),
('moreogromsdal', 'Møre og Romsdal'),
('nordtrondelag', 'Nord-Trøndelag'),
('nordland', 'Nordland'),
('oppland', 'Oppland'),
('oslo', 'Oslo'),
('ostfold', 'Østfold'),
('rogaland', 'Rogaland'),
('sognogfjordane', 'Sogn og Fjordane'),
('svalbard', 'Svalbard'),
('sortrondelag', 'Sør-Trøndelag'),
('telemark', 'Telemark'),
('troms', 'Troms'),
('vestagder', 'Vest-Agder'),
('trondelag', 'Trøndelag'),
('vestfold', 'Vestfold'),
('ostfold', 'Østfold')
('vestland', 'Vestland')
)
18 changes: 7 additions & 11 deletions tests/test_no.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,22 @@ def test_NOMunicipalitySelect(self):
with override('en'):
f = NOMunicipalitySelect()
out = '''<select name="municipalities">
<option value="akershus" selected="selected">Akershus</option>
<option value="austagder">Aust-Agder</option>
<option value="agder" selected="selected">Agder</option>
<option value="akershus">Akershus</option>
<option value="buskerud">Buskerud</option>
<option value="finnmark">Finnmark</option>
<option value="hedmark">Hedmark</option>
<option value="hordaland">Hordaland</option>
<option value="innlandet">Innlandet</option>
<option value="janmayen">Jan Mayen</option>
<option value="moreogromsdal">Møre og Romsdal</option>
<option value="nordtrondelag">Nord-Trøndelag</option>
<option value="nordland">Nordland</option>
<option value="oppland">Oppland</option>
<option value="oslo">Oslo</option>
<option value="ostfold">Østfold</option>
<option value="rogaland">Rogaland</option>
<option value="sognogfjordane">Sogn og Fjordane</option>
<option value="svalbard">Svalbard</option>
<option value="sortrondelag">Sør-Trøndelag</option>
<option value="telemark">Telemark</option>
<option value="troms">Troms</option>
<option value="vestagder">Vest-Agder</option>
<option value="trondelag">Trøndelag</option>
<option value="vestfold">Vestfold</option>
<option value="ostfold">Østfold</option>
<option value="vestland">Vestland</option>
</select>'''
self.assertHTMLEqual(f.render('municipalities', 'akershus'), out)
self.assertHTMLEqual(f.render('municipalities', 'agder'), out)
Loading