feat(hook): make sure to recompute data_format and encoding when the content is changed


Before that patch, and in the context of an update thought a form, the data,
and format as resent.

If the user changes the data, he usually expects the format attribute to be
automatically updated too. But it was not.

With this patch, if the data is changed, and the data_format is the same as
before, we assume it has not been updated by the user, and that it should be
recomputed. On the other hand, if the value is different than the previous
one, we assume it has been changed by the user and we keep this value.
8 jobs for !34 with topic/default/update-data_format in 1 minute and 31 seconds (queued for 5 seconds)
latest detached
Status Name Job ID Coverage
  Lint
passed black #602730
lint black

00:00:28

passed check-dependencies-resolution #602728
lint

00:01:01

passed check-manifest #602731
lint check-manifest

00:00:56

passed flake8 #602734
lint flake8

00:00:36

failed safety #602732
lint safety allowed to fail

00:01:10

passed twine-check #602727
lint twine

00:00:26

failed flake8 #602729
lint flake8

00:00:16

 
  Tests
passed py3 #602733
tests py3

00:01:11

 
Name Stage Failure
failed
safety Lint
| functionality to make sure that the request matches the RFC7230 standard.    |
| Certain proxy servers may not have this functionality though and users are |
| encouraged to upgrade to the latest version of waitress instead. |
+==============================================================================+
ERROR: InvocationError for command /builds/cubicweb/cubes/file/.tox/safety/bin/python -msafety check --full-report (exited with code 255) (exited with code 255)
___________________________________ summary ____________________________________
ERROR: safety: commands failed
Cleaning up file based variables
ERROR: Job failed: command terminated with exit code 1