Fixed a bug when trying to edit variant products.
Merge pull request #1217 from linovia/releases/0.6

Fixed a bug when trying to edit variant products.
Import modules (not classes) where possible
Checkout index view enforces basket must be non-empty

This change introduces a new framework for enforcing checkout
pre-conditions. Each view class can define a class attribute
'pre_conditions' which lists method names to run before the class
itself.

Of course, decorators are more conventional for this kind of thing but
they are harder to override and customise.
Add tests for checkout shipping address view pre-conditions
Add tests for checkout shipping methods view pre-conditions
Extract core events into mixin to clean up tests
Add tests for checkout payment method view pre-conditions
Add tests for checkout payment details view pre-conditions
Remove get_error_response method

It is replaced by the new pre-condition checking.
Remove deprecated methods from checkout components

There were slated for removal in 0.6. The release notes contains info on
what replaces each method.
Rework get_context_data for checkout views

They now all use the same system as PaymentDetailsView where the
submission dict is built and used to form the data for the template.
This should be more consistent and simpler than the previous impl.
Extend PaymentDetailsView to make handling invalid payment forms easier

This change introduces a few new methods in the `PaymentDetailsView` so
less core code needs to be overridden if custom payment forms are
required.
Remove can_basket_be_submitted method

It is now replaced with a checkout pre-condition that applies to every
checkout view. If someone's basket becomes invalid while they are in
checkout, then they will be redirected back to the basket page.
Use a better warning message when baskets become invalid during checkout

Also make the availability warnings start with a lowercase char so they
can be embedded in other sentences easily.
Pass the payment_kwargs back to checkout error responses

This means a payment details form can be rendered with its data intact if
the overall payment process doesn't work (eg the customer got the wrong
CVV).
Move a few methods to OrderPlacementMixin

This simplifies the PaymentDetailsView further.
Adjust checkout flow to better handle billing addresses

This change splits up the flow within the old `post` method. It makes
things easier to override with less duplication from core.
Adjust demo site checkout to use new system
Adjust demo site to collect a billing address

Also show billing address on the thank-you page (if one was saved).