server/test/unittest_migractions.py
changeset 8942 0f60f1061a2e
parent 8935 a8a9ba6f4cdd
child 8947 3bbd416b09ec
equal deleted inserted replaced
8941:7b26fe71404f 8942:0f60f1061a2e
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """unit tests for module cubicweb.server.migractions"""
    18 """unit tests for module cubicweb.server.migractions"""
    19 
    19 
    20 from copy import deepcopy
       
    21 from datetime import date
    20 from datetime import date
    22 from os.path import join
    21 from os.path import join
    23 
    22 
    24 from logilab.common.testlib import TestCase, unittest_main, Tags, tag
    23 from logilab.common.testlib import TestCase, unittest_main, Tags, tag
    25 
    24 
    51         super(MigrationCommandsTC, cls)._init_repo()
    50         super(MigrationCommandsTC, cls)._init_repo()
    52         # we have to read schema from the database to get eid for schema entities
    51         # we have to read schema from the database to get eid for schema entities
    53         config = cls.config
    52         config = cls.config
    54         config._cubes = None
    53         config._cubes = None
    55         cls.repo.fill_schema()
    54         cls.repo.fill_schema()
    56         cls.origschema = deepcopy(cls.repo.schema)
       
    57         # hack to read the schema from data/migrschema
    55         # hack to read the schema from data/migrschema
    58         config.appid = join('data', 'migratedapp')
    56         config.appid = join('data', 'migratedapp')
    59         config._apphome = cls.datapath('migratedapp')
    57         config._apphome = cls.datapath('migratedapp')
    60         global migrschema
    58         global migrschema
    61         migrschema = config.load_schema()
    59         migrschema = config.load_schema()