Some of the packages being used are a bit outdated and therefore we need to update some and remove/replace deprecated one's.
Task check list
[x] Bump up django to version 4.0.0
[x] Bump up django-datatables-view to version 1.20.0. This version supports version Django 4.0.3.
[x] Bump up django-guardian to version 2.4.0. This version supports django version 4.0 although they say it's only being used in their github ci action for running tests. Check.
[x] Bump up django-tracking2 to version 0.5.1
[x] Bump up six to version 1.16.0
[x] Bump up mock to version 5.0.2
[x] Bump up django-reversion to version 5.0.4
[x] Bump up django-debug-toolbar to version 4.0.0
[x] Remove django-nose by performing the following tasks:
[x] Remove TEST_RUNNER and NOSE_ARGS variables in all settings and templates file inside tallyho ansible role.
[x] Update the --settings flag in coverage run command inside the github action file to use common settings instead of dev settings. This will set the log level to INFO when running tests so that the outputs are not too verbose.
[x] Remove django-enumfields and update enum classes to use default Django enums, however this is not urgent since the current version still works with Django 4. Check this documentation on how to define enum fields in models.
[x] Update the following import statements:
from django.utils.translation import ugettext_lazy as _ to from django.utils.translation import gettext_lazy as _.
from django.utils.translation import ugettext_lazy to from django.utils.translation import gettext_lazy.
[x] Rename staticfiles template filter to static.
[x] Rename models.NullBooleanField fields inside models to models.BooleanField(null=True) and create and apply migrations.
[x] Set the following env var in common.py settings file
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
Also update the templates file inside tallyho ansible role.
[x] Fix failing tests if any, at least 5 tests should be failing.
[ ] QA the full app.
Related to
https://github.com/onaio/tally-ho/pull/389 Working skeleton changes of the above task check list. This PR has all the changes suggested above and the app is running except for a few tests that are failing.
Context
Some of the packages being used are a bit outdated and therefore we need to update some and remove/replace deprecated one's.
Task check list
django
to version4.0.0
django-datatables-view
to version1.20.0
. This version supports version Django 4.0.3.django-guardian
to version2.4.0
. This version supports django version 4.0 although they say it's only being used in their github ci action for running tests. Check.django-tracking2
to version0.5.1
six
to version1.16.0
mock
to version5.0.2
django-reversion
to version5.0.4
django-debug-toolbar
to version4.0.0
django-nose
by performing the following tasks:TEST_RUNNER
andNOSE_ARGS
variables in all settings and templates file inside tallyho ansible role.--settings
flag incoverage run
command inside the github action file to usecommon
settings instead ofdev
settings. This will set the log level toINFO
when running tests so that the outputs are not too verbose.django-enumfields
and update enum classes to use default Django enums, however this is not urgent since the current version still works with Django 4. Check this documentation on how to define enum fields in models.from django.utils.translation import ugettext_lazy as _
tofrom django.utils.translation import gettext_lazy as _
.from django.utils.translation import ugettext_lazy
tofrom django.utils.translation import gettext_lazy
.staticfiles
template filter tostatic
.models.NullBooleanField
fields inside models tomodels.BooleanField(null=True)
and create and apply migrations.common.py
settings fileDEFAULT_AUTO_FIELD='django.db.models.AutoField'
Related to