Browse files

Updated list of US states and tests after r15029 to be sorted correctly.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 3e00cf1 commit 4b2b2eda240785dd5146be04ce7357b870ea807a @jezdez jezdez committed Dec 26, 2010
Showing with 5 additions and 2 deletions.
  1. +2 −2 django/contrib/localflavor/us/us_states.py
  2. +3 −0 tests/regressiontests/forms/localflavor/us.py
View
4 django/contrib/localflavor/us/us_states.py
@@ -152,10 +152,10 @@
# All US states and territories plus DC and military mail.
-STATE_CHOICES = US_STATES + US_TERRITORIES + ARMED_FORCES_STATES
+STATE_CHOICES = sorted(US_STATES + US_TERRITORIES + ARMED_FORCES_STATES, key=lambda obj: obj[1])
# All US Postal Service locations.
-USPS_CHOICES = US_STATES + US_TERRITORIES + ARMED_FORCES_STATES + COFA_STATES
+USPS_CHOICES = sorted(US_STATES + US_TERRITORIES + ARMED_FORCES_STATES + COFA_STATES, key=lambda obj: obj[1])
STATES_NORMALIZED = {
'ak': 'AK',
View
3 tests/regressiontests/forms/localflavor/us.py
@@ -13,6 +13,9 @@ def test_USStateSelect(self):
<option value="AS">American Samoa</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
+<option value="AA">Armed Forces Americas</option>
+<option value="AE">Armed Forces Europe</option>
+<option value="AP">Armed Forces Pacific</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>

0 comments on commit 4b2b2ed

Please sign in to comment.