server/test/unittest_migractions.py
changeset 4763 81b0df087375
parent 4691 ae468fae9965
child 4774 89a7555020ba
equal deleted inserted replaced
4762:8dce25da9d95 4763:81b0df087375
    33 
    33 
    34     @classmethod
    34     @classmethod
    35     def _refresh_repo(cls):
    35     def _refresh_repo(cls):
    36         super(MigrationCommandsTC, cls)._refresh_repo()
    36         super(MigrationCommandsTC, cls)._refresh_repo()
    37         cls.repo.set_schema(deepcopy(cls.origschema), resetvreg=False)
    37         cls.repo.set_schema(deepcopy(cls.origschema), resetvreg=False)
       
    38         # reset migration schema eids
       
    39         for eschema in migrschema.entities():
       
    40             eschema.eid = None
       
    41         for rschema in migrschema.relations():
       
    42             rschema.eid = None
       
    43             for rdef in rschema.rdefs.values():
       
    44                 rdef.eid = None
    38 
    45 
    39     def setUp(self):
    46     def setUp(self):
    40         CubicWebTC.setUp(self)
    47         CubicWebTC.setUp(self)
    41         self.mh = ServerMigrationHelper(self.repo.config, migrschema,
    48         self.mh = ServerMigrationHelper(self.repo.config, migrschema,
    42                                         repo=self.repo, cnx=self.cnx,
    49                                         repo=self.repo, cnx=self.cnx,
    43                                         interactive=False)
    50                                         interactive=False)
    44         assert self.cnx is self.mh._cnx
    51         assert self.cnx is self.mh._cnx
    45         assert self.session is self.mh.session, (self.session.id, self.mh.session.id)
    52         assert self.session is self.mh.session, (self.session.id, self.mh.session.id)
    46 
       
    47 
    53 
    48     def test_add_attribute_int(self):
    54     def test_add_attribute_int(self):
    49         self.failIf('whatever' in self.schema)
    55         self.failIf('whatever' in self.schema)
    50         self.request().create_entity('Note')
    56         self.request().create_entity('Note')
    51         self.commit()
    57         self.commit()