Skip to content

Commit

Permalink
using python 2.6 compatible way of assertRaises
Browse files Browse the repository at this point in the history
  • Loading branch information
gitaarik authored and wpjunior committed Nov 30, 2014
1 parent 6d48100 commit 1cac35b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/fields/fields.py
Expand Up @@ -3076,8 +3076,10 @@ def test_undefined_field_exception(self):
class Doc(Document):
foo = StringField(db_field='f')

with self.assertRaises(FieldDoesNotExist):
def test():
Doc(bar='test')

self.assertRaises(FieldDoesNotExist, test)

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

0 comments on commit 1cac35b

Please sign in to comment.