diff -r 3cc6154b94a3 -r 9ca33768473c devtools/testlib.py --- a/devtools/testlib.py Mon Sep 14 11:15:47 2015 +0200 +++ b/devtools/testlib.py Mon Oct 12 10:53:35 2015 +0200 @@ -528,16 +528,18 @@ origperms = erschema.permissions[action] erschema.set_action_permissions(action, actionperms) torestore.append([erschema, action, origperms]) - yield - for erschema, action, permissions in torestore: - if action is None: - erschema.permissions = permissions - else: - erschema.set_action_permissions(action, permissions) + try: + yield + finally: + for erschema, action, permissions in torestore: + if action is None: + erschema.permissions = permissions + else: + erschema.set_action_permissions(action, permissions) def assertModificationDateGreater(self, entity, olddate): entity.cw_attr_cache.pop('modification_date', None) - self.assertTrue(entity.modification_date > olddate) + self.assertGreater(entity.modification_date, olddate) def assertMessageEqual(self, req, params, expected_msg): msg = req.session.data[params['_cwmsgid']]