28 del SchemaModificationHooksTC.schema_eids |
28 del SchemaModificationHooksTC.schema_eids |
29 |
29 |
30 class SchemaModificationHooksTC(CubicWebTC): |
30 class SchemaModificationHooksTC(CubicWebTC): |
31 reset_schema = True |
31 reset_schema = True |
32 |
32 |
33 @classmethod |
33 def setUp(self): |
34 def init_config(cls, config): |
34 super(SchemaModificationHooksTC, self).setUp() |
35 super(SchemaModificationHooksTC, cls).init_config(config) |
35 self.repo.fill_schema() |
36 # we have to read schema from the database to get eid for schema entities |
36 self.__class__.schema_eids = schema_eids_idx(self.repo.schema) |
37 config._cubes = None |
|
38 cls.repo.fill_schema() |
|
39 cls.schema_eids = schema_eids_idx(cls.repo.schema) |
|
40 |
|
41 @classmethod |
|
42 def _refresh_repo(cls): |
|
43 super(SchemaModificationHooksTC, cls)._refresh_repo() |
|
44 restore_schema_eids_idx(cls.repo.schema, cls.schema_eids) |
|
45 |
37 |
46 def index_exists(self, etype, attr, unique=False): |
38 def index_exists(self, etype, attr, unique=False): |
47 self.session.set_pool() |
39 self.session.set_pool() |
48 dbhelper = self.session.pool.source('system').dbhelper |
40 dbhelper = self.session.pool.source('system').dbhelper |
49 sqlcursor = self.session.pool['system'] |
41 sqlcursor = self.session.pool['system'] |