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

Fix COFA validation for USStateField #303

Merged
merged 2 commits into from
Jul 25, 2018

Conversation

elliottcf
Copy link
Contributor

The USPS codes for COFA states aren't in the STATES_NORMALIZED dictionary so they won't validate correctly in a USStateField form field.

I should have caught this in my previous PR, sorry.

@codecov-io
Copy link

codecov-io commented Jul 18, 2017

Codecov Report

Merging #303 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #303   +/-   ##
=======================================
  Coverage   95.82%   95.82%           
=======================================
  Files         153      153           
  Lines        3878     3878           
  Branches      517      517           
=======================================
  Hits         3716     3716           
  Misses         98       98           
  Partials       64       64
Impacted Files Coverage Δ
localflavor/us/us_states.py 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3238773...77063a2. Read the comment docs.

@elliottcf elliottcf reopened this Jul 18, 2017
@benkonrath
Copy link
Member

Is it possible or does it make sense to add some sort of test?

@elliottcf
Copy link
Contributor Author

I'm not against it. If it checked that all fields in the dropdown validate, it would have caught this bug.

@benkonrath
Copy link
Member

That sounds good. I'll cherry-pick this change to the 1.5.x branch as well.

Copy link
Member

@benkonrath benkonrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs a test before it can be merged. Thanks.

@benkonrath
Copy link
Member

@elliottcf Are you still interested in contributing this fix? If so, it would be great to get a test for this change so that I can merge it in. Thanks.

@elliottcf
Copy link
Contributor Author

Yes, I am. I've just been busy with other things so I haven't gotten around to working on the tests you suggested.
I will try to get those written soon.

@benkonrath
Copy link
Member

No problem, I know the feeling. :-) It would be nice to get this into the 2.0 release which I'm hoping to release before the end of the year (see #322). I can always add this fix for 2.0.x and 1.6.x if it doesn't make it into 2.0. Thanks for your help with this.

@benkonrath benkonrath dismissed their stale review July 25, 2018 08:55

Adding a test for this change would need tests for all of STATES_NORMALIZED and this can be added in another PR if desired.

@benkonrath benkonrath merged commit 0528736 into django:master Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants