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.
Bad index in `last_line = covered_lines[-1][1]` (previously [-1][0])
caused rounding error. When you have 3 products for £7 and benefit 3
things per £20, each product would get discount £0.33 which doesn't sum
up to £1. The existing code handles this but bad indexing makes it fail.
A test case reproducing the issue was added.
Fixes #742
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.
This change applies the discount to all matching lines in the benefit
range, weighting the discount by the line prices. The old way was to
iterate over each line and try and apply all the discount.
This new way means that applying an absolute benefit consumes more
products from the basket than the old way, which may possibly have some
confusing side-effects.
This change avoids an issue where customers can get a free product if
they return most of the ordered products apart from the one that was
discounted to zero.
This makes it more efficient to load offers now that we can't simply use
the date filters to exlucde unavailable offers.
The is_active field has been reworked to depend on the
get_max_applications method.
The save method of ConditionalOffer now auto-sets status.
Fixes #403