The previous UPC validation in ``ProductForm`` broke updating the
a product. I realised this while digging around to fix the broken
``StockRecord`` issue that broke the CI build.
The validation now uses Django's validation of ``unique`` fields
instead and works.
The ``StockRecord`` issue was related to creating a form in the
update view providing stock record data in POST with ``partner``
empty. I corrected that and added a test case for it.
Attempting to create a new product with a UPC that already exists
raises an ``IntegrityError`` instead of handling the ``ProductForm``
as an invalid form with an appropriate ``ValidationError``.
I fixed that by adding a ``clean_upc`` validation method to the
form by checking for an existing product by UPC. I am not sure if
that is the most efficient way to validate this. If there's a
better alternative, I am happy to change it...and learn something
:)
**Note:** I switched the functional tests in ``product_tests.py``
to use ``WebTest`` while I was at it.