diff --git a/tests/test_schema.py b/tests/test_schema.py index 18242d6..42cf3c5 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -1140,7 +1140,6 @@ class B(Document): {'doc_type': 'A', 's': unicode(a2.s)}] }) - def testSchemaListPropertyIndex(self): """SchemaListProperty index method """ @@ -1164,8 +1163,10 @@ class B(Document): self.assertEqual(b.slm.index(a1, 1, -2), 2) with self.assertRaises(ValueError) as cm: b.slm.index(a3) - self.assertEqual(str(cm.exception), '{0} is not in list'.format(a3)) - + self.assertIn(str(cm.exception), ( + '{0!r} is not in list'.format(a3), + 'list.index(x): x not in list' + )) def testSchemaListPropertyInsert(self): """SchemaListProperty insert method @@ -1256,8 +1257,10 @@ class B(Document): }) with self.assertRaises(ValueError) as cm: b.slm.remove(a1) - self.assertEqual(str(cm.exception), '{0} is not in list'.format(a1)) - + self.assertIn(str(cm.exception), ( + '{0!r} is not in list'.format(a1), + 'list.index(x): x not in list' + )) def testSchemaListPropertyReverse(self): """SchemaListProperty reverse method