Conversation
|
Hey, @turicas, any news here? Do you think I should go this way? |
|
@InFog, thanks for your PR and sorry for the delay to answer! I'd prefer to do not use |
|
I think a good way to solve this issue would be checking what other projects are doing to handle locales. Having the tests depending on one specific locale is not a good idea, in my opinion. Maybe we could abstract the locale detection and try to use some different locale detection approaches. Still, the first step would be to get rid of locale dependency to run the tests ;) |
fa144f0 to
bbb2c57
Compare
Hello, @turicas.
This is not a final PR, it is still a work in progress.
So, the thing is that I get some errors when running the tests on my machine and it looks like it is because I'm missing the pt_BR.UTF-8 locale.
As you can see in
tests/tests_fields.pyI am importing the locale module to find out the current locale and the decimal point and thousand separator. Then I'm using those values to format the numbers for the tests.I also had to add the locale to the
DecimalFieldclass, because it was looking for thousand separator considering only dots, not commas.Still, my tests are not passing because of those small differences when formatting numbers.
Oh, I also added one missing requirement to the development requirements: openpyxl
Can you please have a look and tell if I'm going in the right direction here? Maybe you have some concerns about the way I'm getting the current locale or something. I'm not a Python developer all the time, so I may be missing something :|
Thanks!