using python 2.6 compatible way of assertRaises
This commit is contained in:
parent
6d48100f44
commit
1cac35be03
@ -3076,8 +3076,10 @@ class FieldTest(unittest.TestCase):
|
||||
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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user