Rework deserialization tests
Rework deserialization tests

There are substantial changes to deserialization tests that warrant some
description. First of all, in the old code there was a path that all data would
have to traverse at it was "imported" from a bundle:
 1) Load JSON from text
 2) Load object model (based on launch_control.models.*) from JSON document
 3) Create or reference database-backed objects from object model

At each step there was some validation and different things could go wrong.
The whole point of step 2 was validation (performed as a side effect of
instantiation all those objects since they had different checks hard-coded
based on their understanding of the JSON schema.

The new model is conceptually simpler:
 1) Load JSON from text
 2) Validate JSON document using appropriate schema (depending on format)
 3) Create or reference database-backed objects from JSON document

Don't think that step 2 is the same. It's not, there is no "format" here.
It's just the _exact_ _raw_ object (JSON document, a python dictionary really)
that was returned by the JSON loader. There is no type mangling (converting
certain strings to datetime.datetime objects for example) or translating all
dictionaries into python classes. The validation works _only_ on the JSON
document (again just a dict of bools, ints, Decimals, strings and lists and
dicts of thereof). The validation looks _only_ at the JSON schema. There is a
single definition of what is considered valid. This is a big improvement, both
conceptually (the model is simple and defined in a single place) and for
performance reasons (the old code spent lots of time instantiating new python
object for each dictionary in the JSON document).

Another improvement comes from usage of DocumentIO from
linaro-python-dashboard-bundle. It allows us to easily evolve the format and
load and check any supported formats using one API. There is also separate API,
not yet used here, DocumentEvolution that allows for converting between older
versions to newer versions without loosing any data. This will be used later
to, for example, allowing users to export old data in most recent and
feature-full format. It will also be a single well defined point for defining
new versions and their schema.

Lastly, all of those changes mean that some tests no longer make any sense.
Previous code had tests that ensured we constructed the "object model" from raw
JSON correctly. This step no longer exists as there is only JSON for storage
and processing and django database model internal application needs.


Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server,OSSystems/lava-server,Linaro/lava-server