Use function as the return value of `get_url_decorator`. This change
needed because `get_url_decorator` method of `OscarConfigMixin` class
returns function or `None` and not string.
* Implement basic abstract thumbnails generator backend
* Create `oscar_thumbnail` template tag in `image_tags`
* Add `easy_thumbnails` to `INSTALLED_APPS` in sandbox settings
* Modify `primary_image` method of `Product` model
* Override in templates Sorl's `thumbnail` tag with `oscar_thumbnail` tag
* Check that related module is installed during thumbnail class initialization
* Add params to `original` field of `ProductImageFactory`
* Add media related URLs to test settings
* Add unit tests for thumbnailer backend
* Create test helpers in `test/utils`
These helpers will be used in tests related to thumbnails
* Add tests to check `oscar_thumbnail` template tag
* Add test to check images/thumbnails deleted for deleted product
* Move `sorl-thumbnail` and `easy-thumbnails` to `extras_require`
With this change these packages can be installed as
* `pip install django-oscar[sorl-thumbnail]`
* `pip install django-oscar[easy-thumbnails]`
* Updated "Template tags" section in docs with info about `oscar_thumbnail`
* Describe `OSCAR_THUMBNAILER` setting in "Settings" section of the docs
* Add information about created thumbnail backend to the release notes
- 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
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.
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.
The changes should be obvious and non-controversial. Under Django 1.7+,
the AppConfig is used to register signal receivers instead of just
registering then when models are registered.
This removes all the bits and bobs where we referenced South, or added
some code supporting it. Documentation will be updated in a later
commit, together with other Django changes.
Working on sets causes a random order of returned fields while using
existing_user_fields as reported in django-oscar/django-oscar#1597.
Changed to work only on lists, which remain correct
order.
Closes #1605.
Closes #1597.
Simplify and increase test coverage for PhoneNumberField
PR #1645 pointed to an issue with phone numbers. After digging into the
code for a while, I opted to redo the phone number field implementation
according to the Django documentation. It always takes me a bit of time
to grok descriptors; the new implementation avoids them.
Note that this does not fix any issue; it's just a simplication done
while searching for the bug.
We only needed it because Django 1.4 shipped with a pretty old version
of six. Support for that has been removed, and Django 1.5 ships with six
1.6.1, which is more current than we required.
This nicely avoids an issue with django-extra-views pinning a six
version which caused the sandbox build to fail:
https://travis-ci.org/tangentlabs/django-oscar/jobs/32223978#L971
A custom app needs to inherit from Oscar's app config. This ensures the
correct app label, and that any startup code (receivers, etc.) is
executed.
Per the camp ground rule, the fork_app command has been slightly
refactored.
I think the Oscar upgrade/forking process for forked apps will get
simpler with the new migrations. One probably will be able to just fake
an initial migration, or something like that. But for now, copying
them across as we did before should be a safe bet.
Add support for methods on User model when checking permissions
The ``permissions_required`` decorator, and hence
``Application.permissions_map`` and
``Application.default_permissions``, now
handle both methods and properties on the User model. Previously, it
wasn't supported, but a docstring showed ``is_anonymous`` as an example,
which is a method.
OSCAR_SLUG_FUNCTION: Support string notation to set slugifier
Importing things in settings is discouraged. But until now,
OSCAR_SLUG_FUNCTION could only be set as a callable, which requires
importing. It's now been updated to use the import_string function.
We ship some apps, e.g. search, without models.py. I think that
means it is not a valid Django app for Django < 1.7. But either way,
Django 1.7 definitely allows apps without models.py, so we need to
ensure we do the right thing.
This makes it easier to customise Oscar. You can run this command to
quickly create local versions of an app that you want to customise. The
command creates the appropriate folder, __init__.py and models.py. The
only step requiring human intervention is to modify INSTALLED_APPS to
include the new app package.
Replace CsvUnicodeWriter with Python 3 compatible UnicodeCSVWriter
This required extending the UnicodeCSVWriter to be able to deal with
file-like objects as well. This is used to create downloadable CSV files
in memory.