[test][invalid_database] Build error string the same as jsonschema

This allows to build the error message as expected with both
Python 2 and 3.
1 job for py3_compatibility in 20 minutes and 13 seconds