hooks/test/unittest_syncschema.py
brancholdstable
changeset 7078 bad26a22fe29
parent 6781 5062d86d6ffe
child 7244 a918f76441ce
equal deleted inserted replaced
7074:e4580e5f0703 7078:bad26a22fe29
    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']