[test] fix regression introduced in 7915:a7f3245e1728 leading to test's postcreate not being executed anymore stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Oct 2011 09:23:43 +0200
branchstable
changeset 7974 77eec6d6e144
parent 7972 99210c8b63b0
child 7975 6ea7378b2c14
[test] fix regression introduced in 7915:a7f3245e1728 leading to test's postcreate not being executed anymore
server/__init__.py
server/migractions.py
--- a/server/__init__.py	Tue Oct 18 12:22:48 2011 +0200
+++ b/server/__init__.py	Fri Oct 21 09:23:43 2011 +0200
@@ -243,6 +243,8 @@
         # execute cubes pre<event> script if any
         for cube in reversed(cubes):
             mhandler.cmd_exec_event_script('pre%s' % event, cube)
+        # execute instance's pre<event> script (useful in tests)
+        mhandler.cmd_exec_event_script('pre%s' % event, apphome=True)
         # enter instance'schema into the database
         session.set_cnxset()
         serialize_schema(session, schema)
@@ -251,6 +253,8 @@
         # execute cubes'post<event> script if any
         for cube in reversed(cubes):
             mhandler.cmd_exec_event_script('post%s' % event, cube)
+        # execute instance's post<event> script (useful in tests)
+        mhandler.cmd_exec_event_script('post%s' % event, apphome=True)
 
 
 # sqlite'stored procedures have to be registered at connection opening time
--- a/server/migractions.py	Tue Oct 18 12:22:48 2011 +0200
+++ b/server/migractions.py	Fri Oct 21 09:23:43 2011 +0200
@@ -359,6 +359,8 @@
         if cube:
             cubepath = self.config.cube_dir(cube)
             apc = osp.join(cubepath, 'migration', '%s.py' % event)
+        elif kwargs.pop('apphome', False):
+            apc = osp.join(self.config.apphome, 'migration', '%s.py' % event)
         else:
             apc = osp.join(self.config.migration_scripts_dir(), '%s.py' % event)
         if osp.exists(apc):