Refactor Benefit clean methods and add tests for all of them.
- Refactor clean methods to return all validation errors, rather than just the first one we found.
- Fix clean method type errors in Python 3
- Add tests for the clean methods for all benefit types.
This involves some quite involved changes to the internals of how offers
and organised. A new boolean field has been added to the offer model to
indicate whether to apply to prices exclusive of tax. This is used
within the offer methods to determine whether a basket meets a
condition, and how to apply the benefit if it does.
Fixes #925
Fixes #924
Hmmm, this turned out to be a monster commit. This change allows the
basket to be able to correctly calculate prices including tax.
It also requires a whole load of test changes since all baskets now
require a strategy instance to be assigned.
This allows updating code in both places, if necessary. Getting Django
1.5 support would be painful otherwise. This also removes the circular
dependency of django-oscar-testsupport on Oscar.
The requirements were merged. The imports were updated
accordingly. Unused imports in the touched files were removed. No
further changes.
Consumption now sorts the basket lines in descending price order so that
the most expensive products are consumed first. This means that
multibuys apply in a more natural way.
Fixes #348
This is a major clean-up of offers, tidying up the implementations and
rewriting the test suite. This should also clean up some edge cases
around the use of max_affected_items.