- Move Oscar app configs into Django app config classes
- Rename Oscar/Django apps' app config module
- Remove "oscar.get_core_apps()" and its app overriding
- Remove "oscar.OSCAR_CORE_APPS"
- Port app forking code to work with Django app registry
- Port class loading code to use app configs to get app properties
With this change phone numbers (any qty) can be added as `ModelForm`
property `phone_numbers_fields` - dict where "keys" are names of
phone numbers fields and "values" are attributes of fields.
* `PhoneNumberMixin` clightly reworked and moved
from `oscar.views.generic` to `oscar.forms.mixins`
* Couple tests added (based on previous tests)
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.
The tests were failing on python 2 due to the fact that the __init__.py
wasn't written so it wasn't a valid module. With this commit we now
also fully leverage pytest functionality to handle temporary paths for
us.
Add setting to allow SlugField and AutoSlugField accept unicode and automatically generate unicode-containing slugs.
Since there is no way to override SlugField and AutoSlugField in existing Oscar models, it was decided to pass `allow_unicode` parameter if this setting enable. This allows to achieve backwards compatibility with Django versions under 1.9, when this parameter was not supported yet. If parameter specified in the field expliticly - we do not override it, which allow to control slug fields individually in a normal way. For the reasons, explained above, standard SlugField was replaced with a custom one with the single slight change - control over `allow_unicode` parameter by the mentioned setting.
The tests check if the year 2010 is a valid option but since only the
last 5 years are rendered this is no longer the case. For now I've
changed the tests to check if 2014 is valid which should be the case the
next few years. A better option is to use the `freezegun` module in the
future.
Replace assert statements with appropriate assert* method.
Replace 'assert' with 'assert*' method.
Convert tests.unit.forms.widget_tests to use TestCase class.
Convert bankcard tests to use TestCase.
Convert tests.unit.logging_tests to use TestCase.
Fix validate_payment_event for payment events with no lines specified
Currently, handle_payment_event defaults lines and line_quantities to None,
however, calling it with these defaults will result in an exception being
raised in validate_payment_event because it expects iterables.
This commit also adds tests to cover validate_payment_event.
Fixes stockrecord availability validation message in the case when stock is lower than allocation. Previously the message that appeared contained negative numbers. For example: "a maximum of -1 can be bought". Now it will display: "no stock available"
The offer tests contained a stray test case that I suppose was once
intended as a base class for all the other tests. But it's only used
twice, and for very little gain, so let's delete it.