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.
Fix ValueError in tests when assigning unsaved instance
Django now throws a ValueError when an unsaved instance is assigned:
https://docs.djangoproject.com/en/1.8/releases/1.8/#assigning-unsaved-objects-to-relations-raises-an-error
This commit changes the offending lines to create objects in the
database instead. But I don't understand why I don't need to make
the same changes for e.g. the country factory.
But I don't really care, as long as the tests pass. I'm guessing it has
something to do with factory-boy and the get_or_create statement.
Unfortunately, this will make our test suite slower. But to make up for
it, Django 1.8 introduces the setUpTestCase method, which we can use
once Django 1.7 is removed.
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.
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.
* They are now known as 'stock alerts' instead of notifications.
* They have been moved into the customer app largely (instead of their
own one).
* The model implementation has been simplified.