tangentlabs/django-oscar — pull request #1340 by codeinthehole (2014-05-23 14:55:52+00:00)
Title: Basket forms rework

I started this journey trying to fix a pesky issue around trying to add products to the basket with different currencies. It turned into an almighty yak-shave where I rewrote the add-to-basket workflow fairly significantly.

I also extended Oscar's suite of factory boy factories, which are coming on quite nicely now and can be more widely re-used.

The work also highlighted a few code smells as deep mocking was required to write some tests for the basket form as it has deep knowledge of the basket strategy class. This article is required reading around this topic:
https://www.destroyallsoftware.com/blog/2014/test-isolation-is-about-avoiding-mocks

I intend to revisit this area and try to adjust how the basket form works (again!) to reduce the coupling.