Add datetime attribute to ProductAttributeValue as asked for in issue #2389 (#2393)
* Add datetime attribute to ProductAttributeValue as asked for in issue #2389
Used widget DateTimePickerInput from oscar.forms.widgets
* Fix migration catalogue 0012 (was error with python3)
* Add tests for ProductAttributeValue
Fix handling of free products when calculating basket totals in Python 3.
In Python 2, adding None to the basket total worked, but in Python 3 this raises a TypeError. This fixes the handling of totals to distinguish between a zero price and a non-existent price.
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.
Fix logic for checking whether an offer is active based on date.
- If start_datetime is null, then the offer has no start date.
- If end_datetime is null, then the offer never expires.
Use the ActiveOfferManager in Applicator.get_site_offers instead of
reimplementing the same logic there.
Fixes #2344.
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.
Fix a race condition when using single-usage vouchers
The initial check if the voucher is available was done before creating
the order. This change adds a validation step during the order creation
within an atomic() block.
See #2101
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
The pk kwarg on views is a string type. The message format string was expecting a numeric value. This updates that format string to expect a string value, which will always display correctly.
The idea of splitting integration from unittests is good in theory
but leads to a lot of mental overhead. Besides whenever a tests
interacts with a database it isn't a unittest anyway.