Add compatibility for Django 2.1, and drop support for Python 3.4.
Django 2.1 works fine - the only issue was that more passwords
have been added to the CommonPasswordValidator which caused some tests
to fail. I've removed that validator from the test settings.
Switch to using Django's password validation framework in Django >=1.9
Django 1.9 introduced the AUTH_PASSWORD_VALIDATORS setting which allows for
more flexible password validation. Switch to using that when it is available,
with a fallback to Oscar's previous behaviour in Django 1.8 or when this
setting is empty.
Cleanup unused benefits and conditions after conditional offer removal.
Now after ConditionalOffer deleted will be deleted related Benefits and Conditions models (through post_delete signal) if they are no longer used by other offers (with exception of custom benefits/conditions). Plus some small changes related to PEP8 and typos.
Most real-world instances will use postgresql instead of sqlite so it's
better to use postgres for the tests. This also allows us to easily add
tests for concurrency issues which is not supported by sqlite
django-compressor served it's purpose, but given the advent of
more and more frontend JS work, and the accompanying build tools (grunt,
gulp, etc.), it makes less and less sense to use compressor. Jannis
Leidel himself also stepped back from maintaining it.
In my experience with Oscar project, it has also become a bit of a
liability to have compressor as a dependency. Most projects don't use it
any more, but it's not easy to disable/override because all our
templates include it.
So, let's keep things simple and remove it as a dependency. That paves
the way for using other tools, while it's always easy to add back.
I'm not sure why @codeinthehole, back in the days, opted to
manually configure settings instead of using a regular settings file for
the test suite. Most likely the reasons for doing so have disappeared.
So I turned our tests/config.py into a normal settings file, and use
that accordingly. That means we do things the standard Django way, and
it's easier to drop into a session with the test settings.