Fix site notifications generated by send_product_alerts.
Notification subjects have a max length of 255 characters, which can easily be exceeded by long product names. Change the alert logic to provide a short notification subject and put the longer content in the notification body.
This patch also modifies the notification utils to make it obvious that the positional argument is a notification subject, not a body.
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.
[Backport] existing_user_fields: Fetch User model only when called
Otherwise it may cause Django start up pains, and does cause migrations
to fail. Thanks to Jonathan Moss for reporting.
(cherry picked from commit fa3f793a35)
Conflicts:
tests/integration/customer/test_custom_user_model.py
[Backport] Use existing_fields for UserForm, and use correct User model
I messed up when moving Alex Moon's code to oscar.core.compat and used
the wrong User model, defeating the point of the exercise.
This is fixed now, and the filter is also used for the UserForm that
gets used in the account section.
Fixes #1283.
Fixes #1282.
(cherry picked from commit 20df512eda)
Conflicts:
oscar/apps/customer/forms.py
Use existing_fields filter for UserForm, and use correct User model
I messed up when moving Alex Moon's code to oscar.core.compat and used
the wrong User model, defeating the point of the exercise.
This is fixed now, and the filter is also used for the UserForm that
gets used in the account section.
Fixes #1283.
Fixes #1282.
Adjust import of `StockAlert` to avoid circular reference
We now use the related manager to access the model class rather than
importing at runtime which causes a circular reference.
Fixes issues reported in comments of #1127
Previously, the test suite ran with a custom user model for Django >=
1.5, but it didn't subclass Oscar's AbstractUser. This commit adjusts
the custom user model to subclass Oscar's so we can test functionality
within the custom user class.
This does require a change to the way tests authenticate as we don't
actually use the username field.