Skip to content

ValidationError is not Hashable (2.0.0) #452

@Guibod

Description

@Guibod

I can't logging.exception(ValidationError) it seems that the object is not hashable.

That's sad, it used to work pretty well on 1.1. I'm using Python 3.4.

class TestUnhashable(unittest.TestCase):
    def test_type_error_is_hashable(self):
        try:
            raise TypeError('Foo bar')
        except TypeError as e:
            logging.exception(e)

    def test_validation_error_is_unhashable(self):
        try:
            raise ValidationError('Foo bar')
        except ValidationError as e:
            with self.assertRaises(TypeError) as c:
                logging.exception(e)

            self.assertIsInstance(c.exception, TypeError)
            self.assertEqual(c.exception.args[0], 'unhashable type: \'ValidationError\'')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions