using python 2.6 compatible way of assertRaises
This commit is contained in:
@@ -3076,8 +3076,10 @@ class FieldTest(unittest.TestCase):
|
|||||||
class Doc(Document):
|
class Doc(Document):
|
||||||
foo = StringField(db_field='f')
|
foo = StringField(db_field='f')
|
||||||
|
|
||||||
with self.assertRaises(FieldDoesNotExist):
|
def test():
|
||||||
Doc(bar='test')
|
Doc(bar='test')
|
||||||
|
|
||||||
|
self.assertRaises(FieldDoesNotExist, test)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Reference in New Issue
Block a user