256 finally: |
256 finally: |
257 self.mh.cmd_change_relation_props('Personne', 'adel', 'String', |
257 self.mh.cmd_change_relation_props('Personne', 'adel', 'String', |
258 fulltextindexed=False) |
258 fulltextindexed=False) |
259 |
259 |
260 def test_sync_schema_props_perms(self): |
260 def test_sync_schema_props_perms(self): |
261 cursor = self.mh.rqlcursor |
261 cursor = self.mh.session |
262 nbrqlexpr_start = len(cursor.execute('RQLExpression X')) |
262 nbrqlexpr_start = len(cursor.execute('RQLExpression X')) |
263 migrschema['titre']._rproperties[('Personne', 'String')]['order'] = 7 |
263 migrschema['titre']._rproperties[('Personne', 'String')]['order'] = 7 |
264 migrschema['adel']._rproperties[('Personne', 'String')]['order'] = 6 |
264 migrschema['adel']._rproperties[('Personne', 'String')]['order'] = 6 |
265 migrschema['ass']._rproperties[('Personne', 'String')]['order'] = 5 |
265 migrschema['ass']._rproperties[('Personne', 'String')]['order'] = 5 |
266 migrschema['Personne'].description = 'blabla bla' |
266 migrschema['Personne'].description = 'blabla bla' |
335 |
335 |
336 self.mh.rollback() |
336 self.mh.rollback() |
337 |
337 |
338 def _erqlexpr_rset(self, action, ertype): |
338 def _erqlexpr_rset(self, action, ertype): |
339 rql = 'RQLExpression X WHERE ET is CWEType, ET %s_permission X, ET name %%(name)s' % action |
339 rql = 'RQLExpression X WHERE ET is CWEType, ET %s_permission X, ET name %%(name)s' % action |
340 return self.mh.rqlcursor.execute(rql, {'name': ertype}) |
340 return self.mh.session.execute(rql, {'name': ertype}) |
341 def _erqlexpr_entity(self, action, ertype): |
341 def _erqlexpr_entity(self, action, ertype): |
342 rset = self._erqlexpr_rset(action, ertype) |
342 rset = self._erqlexpr_rset(action, ertype) |
343 self.assertEquals(len(rset), 1) |
343 self.assertEquals(len(rset), 1) |
344 return rset.get_entity(0, 0) |
344 return rset.get_entity(0, 0) |
345 def _rrqlexpr_rset(self, action, ertype): |
345 def _rrqlexpr_rset(self, action, ertype): |
346 rql = 'RQLExpression X WHERE ET is CWRType, ET %s_permission X, ET name %%(name)s' % action |
346 rql = 'RQLExpression X WHERE ET is CWRType, ET %s_permission X, ET name %%(name)s' % action |
347 return self.mh.rqlcursor.execute(rql, {'name': ertype}) |
347 return self.mh.session.execute(rql, {'name': ertype}) |
348 def _rrqlexpr_entity(self, action, ertype): |
348 def _rrqlexpr_entity(self, action, ertype): |
349 rset = self._rrqlexpr_rset(action, ertype) |
349 rset = self._rrqlexpr_rset(action, ertype) |
350 self.assertEquals(len(rset), 1) |
350 self.assertEquals(len(rset), 1) |
351 return rset.get_entity(0, 0) |
351 return rset.get_entity(0, 0) |
352 |
352 |