Added CNPJ and CPF validation formats#172
Conversation
|
I'd like to bring the validations out of the clean method. Allowing users to use the validation functions directly. Could I do that? Thanks |
|
When reading the test updates, it's not obvious for me what you are trying to solve with this patch. If the only result is to have a different error message, it's not worth it I think. If your changes allow to catch more errors, please reflect that in the tests also. |
|
I've added a CNPJ number to the tests: This PR makes that invalid. |
|
Good, a similar test for CPF would be nice. |
d9a23e9 to
9698221
Compare
|
@claudep oh... thanks, I forgot that. u.u |
[br] Added CNPJ and CPF validation formats
|
@claudep Do you have any ideas about what happened with the builds py27-master and py34-master that raised an AssertionError in the Chilean RUT? Every other env has passed successfully. Anything else I should do? I'll create another PR to add validation formats to the BRProcessoField too and add tests to it, if that's ok. Thanks. |
|
I'm investigating the issue about test failures. But it's unrelated to this patch, that's why I merged it. |
|
Awesome! Thanks. |
Changed the re.sub to avoid cleaning CNPJ and CPF numbers sent in the wrong format.
Removed errors_numbersonly since the regex will take care of validating and raising a ValidationError with the error_format message.
If the message of errors_numbersonly error must be kept, just let me know.