Skip to content

Commit

Permalink
Added test for content.validate_fields raise_on_errors=True parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gbastien committed Oct 22, 2018
1 parent 8559023 commit d67ff4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/imio/helpers/tests/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ def test_validate_fields(self):
obj.mandatory_textline = None
self.assertEqual(validate_fields(obj),
[WrongType(None, unicode, 'mandatory_textline')])
# validate_fields may raise a ValueError if raise_on_errors=True
self.assertRaises(ValueError, validate_fields, obj, raise_on_errors=True)
# back to correct value
obj.mandatory_textline = u'Some text'
self.assertFalse(validate_fields(obj))

Expand Down

0 comments on commit d67ff4a

Please sign in to comment.