Improve HTTP PUT API tests, reorganize code

There are API tests that issue HTTP PUT requests and check the status code
returned by those HTTP requests. However, there are not tests which check
whether the just-updated entities were correctly updated. Add tests of this kind.

Reorganize code. Move methods `test_post_and_get` and `test_put_and_get` into
their own test case. This is done so that the `longMessage` class variable can
be used. This variable allows good quality error messages to be written while
using a minimum of code.

Update the docstring for class `EntityTestCase`.

Add a new assertion to method `test_post_status_code` and update its docstring
accordingly.
Merge pull request #1068 from Ichimonji10/api-tests

Improve HTTP PUT API tests, reorganize code