Skip to content

Commit

Permalink
Unit Tests for #954 Fail on Exception, not Error
Browse files Browse the repository at this point in the history
  • Loading branch information
mmellison committed Apr 29, 2015
1 parent 5d6a289 commit f2cbcea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/document/validation.py
Expand Up @@ -183,7 +183,10 @@ class Child(Parent):
child = Child(reference=parent)

# Saving child should not raise a ValidationError
child.save()
try:
child.save()
except ValidationError as e:
self.fail("ValidationError raised: %s" % e.message)

def test_parent_reference_set_as_attribute_in_child_document(self):
"""
Expand All @@ -204,7 +207,11 @@ class Child(Parent):
child.reference = parent

# Saving the child should not raise a ValidationError
child.save()
try:
child.save()
except ValidationError as e:
self.fail("ValidationError raised: %s" % e.message)


if __name__ == '__main__':
unittest.main()

0 comments on commit f2cbcea

Please sign in to comment.