Modernize and enhance settings upgrades for upcoming postgresql changes.
Review Request #11373 — Created Jan. 12, 2021 and submitted
Our settings upgrade code is pretty old, and a bit crufty. While most of
it is unlikely to ever need to be run again, it's worth keeping it here
and maintainable than not. Particularly as we iterate on it.
Part of this change fixes improves how we output upgraded settings for
databases and cache backends.
The other part upgrades the
postgresql. A little history here: Originally, ages ago, Django had
two backends, and recommended moving
postgresql_psycopg2, and we had upgrade code handling this. Then they
flipped this, and in Django 1.9 the
psycopg2variant became an alias,
which was then formally deprecated in 2.0, and removed in 3.0.
Review Board 4.0 doesn't particularly care which is used, but in order
to future-proof, we're handling the upgrades now, moving to the plain
Unit tests were added to check the settings upgrade machinery.
Unit tests pass on all supported versions of Python.