[test] swap order in assert of `test_users_and_groups_non_readable_by_guests`
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 26 Nov 2012 12:52:33 +0100
changeset 8624 7e415f457155
parent 8623 9f7481a05383
child 8625 7ee0752178e5
[test] swap order in assert of `test_users_and_groups_non_readable_by_guests` unittest2 order is (expected, got), not the opposite. This help test report readbility.
server/test/unittest_security.py
--- a/server/test/unittest_security.py	Mon Nov 26 19:47:12 2012 +0100
+++ b/server/test/unittest_security.py	Mon Nov 26 12:52:33 2012 +0100
@@ -473,9 +473,9 @@
             anon = cu.connection.user(self.session)
             # anonymous user can only read itself
             rset = cu.execute('Any L WHERE X owned_by U, U login L')
-            self.assertEqual(rset.rows, [['anon']])
+            self.assertEqual([['anon']], rset.rows)
             rset = cu.execute('CWUser X')
-            self.assertEqual(rset.rows, [[anon.eid]])
+            self.assertEqual([[anon.eid]], rset.rows)
             # anonymous user can read groups (necessary to check allowed transitions for instance)
             self.assert_(cu.execute('CWGroup X'))
             # should only be able to read the anonymous user, not another one
@@ -488,7 +488,7 @@
             #                  {'x': self.user.eid})
 
             rset = cu.execute('CWUser X WHERE X eid %(x)s', {'x': anon.eid})
-            self.assertEqual(rset.rows, [[anon.eid]])
+            self.assertEqual([[anon.eid]], rset.rows)
             # but can't modify it
             cu.execute('SET X login "toto" WHERE X eid %(x)s', {'x': anon.eid})
             self.assertRaises(Unauthorized, self.commit)