Deprecate generic.checksums.luhn and ean#370
Conversation
tests/test_deprecated.py
Outdated
|
|
||
|
|
||
| class DeprecatedFieldsTests(SimpleTestCase): | ||
| @patch('localflavor.generic.checksums.stdnum_luhn') |
There was a problem hiding this comment.
Not sure, what is the role of patch here?
There was a problem hiding this comment.
Oh, for the assertion below? All that just for testing a deprecation. I wouldn't have moaned if you omitted that :-)
There was a problem hiding this comment.
I agree it's a bit pedantic - thanks for pointing this out. Removing these tests also means I can remove the additional requirement for mock on Python 2 which simplifies things a bit.
tests/test_deprecated.py
Outdated
| luhn('1234') | ||
|
|
||
| self.assertTrue(all(w.category is RemovedInLocalflavor30Warning for w in recorded)) | ||
| stdnum_luhn.asert_called_once_with('1234') |
There was a problem hiding this comment.
Strange that the tests don't fail with the typ0 asert vs assert
There was a problem hiding this comment.
That's mock - it silently allows undefined methods to be called without raising an error.
There was a problem hiding this comment.
By the way - nice catch! :-)
Codecov Report
@@ Coverage Diff @@
## master #370 +/- ##
==========================================
- Coverage 96% 95.95% -0.06%
==========================================
Files 160 160
Lines 4058 4051 -7
Branches 528 525 -3
==========================================
- Hits 3896 3887 -9
- Misses 98 99 +1
- Partials 64 65 +1
Continue to review full report at Codecov.
|
I've been meaning to do this for a while. As the code suggests, my plan is to remove the
generic.checksums.luhnandgeneric.checksums.eanfunctions in 3.0 - users should just use python-stdnum directly.@claudep If you have time a review and your thoughts on this plan would be helpful. Thanks.