diff -r 403a901b6b1e -r 09be48c01fa4 cubicweb/server/test/unittest_postgres.py --- a/cubicweb/server/test/unittest_postgres.py Thu Jan 14 18:35:07 2016 +0100 +++ b/cubicweb/server/test/unittest_postgres.py Thu Jan 14 17:42:22 2016 +0100 @@ -169,16 +169,16 @@ with self.admin_access.repo_cnx() as cnx: def sql(string): return cnx.system_sql(string).fetchone()[0] - yield self.assertEqual, sql("SELECT limit_size('

hello

', 'text/html', 20)"), \ - '

hello

' - yield self.assertEqual, sql("SELECT limit_size('

hello

', 'text/html', 2)"), \ - 'he...' - yield self.assertEqual, sql("SELECT limit_size('
hello', 'text/html', 2)"), \ - 'he...' - yield self.assertEqual, sql("SELECT limit_size('hello', 'text/html', 2)"), \ - 'he...' - yield self.assertEqual, sql("SELECT limit_size('a>b', 'text/html', 2)"), \ - 'a>...' + for html, size, expected in [ + ('

hello

', 20, '

hello

'), + ('

hello

', 2, 'he...'), + ('
hello', 2, 'he...'), + ('hello', 2, 'he...'), + ('a>b', 2, 'a>...'), + ]: + with self.subTest(html=html, size=size): + actual = sql("SELECT limit_size('%s', 'text/html', %d)" % (html, size)) + self.assertEqual(actual, expected) if __name__ == '__main__':