Factory Boy for test fixtures & port address model tests
As previously discussed here
https://groups.google.com/d/topic/django-oscar/Owmi3J1rwlk/discussion
I have started working on the introduction of Factoryboy library into
django-oscar, to make the generation of data for unit tests easier. At
the moment I have only refactored test/unit/address/models_tests.py, but
the plan is to refactor all the existing tests. All the tests, of
course, pass.
Squashed commit of the work done in #1192
Fixes #1192
This change adds a uniqueness constraint on user addresses to prevent
duplicates. A few changes follow:
- The user address forms in account and checkout are modified to take a
user as a constructor arg so uniqueness can be checked.
- The assignment of a user when creating a new address has been moved
into the form.