Add missing tests for db.instance_type_* methods

There was no tests in test_db_api for instance_type_* methods.

Add tests to ensure that all works.
Also these tests allow us to refactor work with session and
to add missing unique constraints.

Fix bug in instance_type_get_all, we shouldn't remove
is_public from input filters dictionary.

blueprint db-api-tests

Change-Id: Ia02d73e6ffd964d6edb605039eb95e9f90ff0482
Bring back colorizer again with error results.

This was actually a pretty simple fix. When I switched the base
test result class to testtools I lost the methods that were
printing out the errors at the end. This adds the (colorized!)
methods so errors print successfully.

fixes bug 1159116

Change-Id: Ib09d7e18ddf27015ff735a30137421d865382359
Add a format_message method to the Exceptions

This patch adds a format_message method to the NovaException class that
will almost always do what a user wants, when they want to print out the
message of the exception.

Exceptions that are received through RPC are turned into an actual
exception classes by the deserialize_remote_exception function of the
nova.openstack.common.rpc.common module. This function then overrides
__str__ and __unicode__ methods of a new class to print the whole trace.
We still want to preserve this functionality (for logging) but do not
want to leak the trace back to the user in the HTTP response.

Based on the above, This patch attempts to establish a convention that
states: if you need to get the message of a NovaException subclass -
always use the format_message method. Only use str(e) or unicode(e) when
you suspect that they were overriden.

Initially this was attempted through adding a custom metaclass to the
NovaException class so that format_message cannot be overridden in
subclasses, however due to a bug in testtools - many tests were failing.
A patch was proposed to testtols to remedy this
(https://github.com/testing-cabal/testtools/pull/34) however until it is
merged, we cannot use metaclasses with our exception classes as they
cause tests to fail.

Change-Id: I0a399b9ab3227bad644b031c9b689fe0ce64586e
Merge "Bring back colorizer again with error results."
Merge "Add missing tests for db.instance_type_* methods"
Merge "Add a format_message method to the Exceptions"