Cleaned up tests for multiple databases.
Fixed transaction handling for a number of operations on related objects.

Thanks Anssi and Aymeric for the reviews. Refs #21174.
Merge pull request #2489 from loic/related_transactions

Fixed transaction handling for a number of operations on related objects.
Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.

Since assignments on M2M or reverse FK descriptors is composed of a `clear()`,
followed by an `add()`, `clear()` could potentially affect the value of the
assigned queryset before the `add()` step; pre-evaluating it solves the problem.

This patch fixes the issue for ForeignRelatedObjectsDescriptor,
ManyRelatedObjectsDescriptor, and ReverseGenericRelatedObjectsDescriptor.
It completes 6cb6e1 which addressed ReverseManyRelatedObjectsDescriptor.
Merge pull request #2487 from loic/ticket19816

Fixed #19816 -- Pre-evaluate querysets used in direct relation assignments.
Fixed mistake in tests from commit 2039908. Refs #19816.
Merge pull request #2495 from loic/ticket19816

Fixed mistake in tests from commit 2039908. Refs #19816.
Fixed #22338 -- Fixed a test dependent on dictionary key iteration order.
Ensure that a file is closed in the tests
Corrected many style guide violations that the newest version of flake8 catches
Added Python 3.4 to classifiers in setup.py.
Corrected an import in a model form docs example.