unicef / etools-issues

0 stars 2 forks source link

App models need str/unicode attention (Python 3 compatibility) #746

Open caktus-philip opened 7 years ago

caktus-philip commented 7 years ago

All eTools models that implement __unicode__() need Django's @python_2_unicode_compatible decorator to ensure Python 3 compatibility.

https://docs.djangoproject.com/en/1.11/ref/utils/#django.utils.encoding.python_2_unicode_compatible

In addition, each model needs a test that uses non-ASCII characters to exercise str(instance) and unicode(instance).

The following apps need attention (checked when PR is merged) --

The last item (meta test) refers to a test in test_all_models.py that ensures that each model in eTools implements @python_2_unicode_compatible. At present, the test is mostly disabled because most app models don't yet implement the decorator, but as apps in the list above are checked off one by one, I'll add them to the meta test. Once the meta test is in place, it should catch any new models that are added to eTools to ensure the project doesn't slip out of compatibility.

caktus-philip commented 6 years ago

Almost complete! All that remains is for prp-refactoring to be merged into develop (thus merging #1053 into develop) and then removing partners from the EXCLUDED_PACKAGES list in test_all_models.py