# HG changeset patch # User Philippe Pepiot # Date 1493133078 -7200 # Node ID 72a890b713c17c18c9f84494749f6805e4ea6120 # Parent 14f85569eda2ae68002a245ed4139796e443e9fc [test] make assertions on exception message diff -r 14f85569eda2 -r 72a890b713c1 cubicweb/test/unittest_req.py --- a/cubicweb/test/unittest_req.py Tue Apr 25 17:10:16 2017 +0200 +++ b/cubicweb/test/unittest_req.py Tue Apr 25 17:11:18 2017 +0200 @@ -147,13 +147,19 @@ users = list(users) self.assertEqual(len(users), 2) - with self.assertRaises(AssertionError): + with self.assertRaisesRegexp( + AssertionError, '^chapeau not in CWUser subject relations$' + ): req.find('CWUser', chapeau=u"melon") - with self.assertRaises(AssertionError): + with self.assertRaisesRegexp( + AssertionError, '^buddy not in CWUser object relations$' + ): req.find('CWUser', reverse_buddy=users[0]) - with self.assertRaises(NotImplementedError): + with self.assertRaisesRegexp( + NotImplementedError, '^in_group: list of values are not supported$' + ): req.find('CWUser', in_group=[1, 2])