hooks/test/unittest_syncschema.py
changeset 10442 b2d2099dfae8
parent 10436 6493c8bf521d
child 10813 ab626726a70a
equal deleted inserted replaced
10441:1d0f4064a87e 10442:b2d2099dfae8
    19 
    19 
    20 from logilab.common.testlib import unittest_main
    20 from logilab.common.testlib import unittest_main
    21 
    21 
    22 from cubicweb import ValidationError, Binary
    22 from cubicweb import ValidationError, Binary
    23 from cubicweb.schema import META_RTYPES
    23 from cubicweb.schema import META_RTYPES
       
    24 from cubicweb.devtools import startpgcluster, stoppgcluster, PostgresApptestConfiguration
    24 from cubicweb.devtools.testlib import CubicWebTC
    25 from cubicweb.devtools.testlib import CubicWebTC
    25 from cubicweb.server.sqlutils import SQL_PREFIX
    26 from cubicweb.server.sqlutils import SQL_PREFIX
    26 from cubicweb.devtools.repotest import schema_eids_idx
    27 from cubicweb.devtools.repotest import schema_eids_idx
    27 
    28 
    28 
    29 
       
    30 def setUpModule():
       
    31     startpgcluster(__file__)
       
    32 
       
    33 
    29 def tearDownModule(*args):
    34 def tearDownModule(*args):
       
    35     stoppgcluster(__file__)
    30     del SchemaModificationHooksTC.schema_eids
    36     del SchemaModificationHooksTC.schema_eids
    31 
    37 
       
    38 
    32 class SchemaModificationHooksTC(CubicWebTC):
    39 class SchemaModificationHooksTC(CubicWebTC):
       
    40     configcls = PostgresApptestConfiguration
    33 
    41 
    34     def setUp(self):
    42     def setUp(self):
    35         super(SchemaModificationHooksTC, self).setUp()
    43         super(SchemaModificationHooksTC, self).setUp()
    36         self.repo.set_schema(self.repo.deserialize_schema(), resetvreg=False)
    44         self.repo.set_schema(self.repo.deserialize_schema(), resetvreg=False)
    37         self.__class__.schema_eids = schema_eids_idx(self.repo.schema)
    45         self.__class__.schema_eids = schema_eids_idx(self.repo.schema)