Log message for revision 122782: Revert part of c122071 and always get a VHM back
Changed: U Zope/trunk/src/OFS/Application.py U Zope/trunk/src/OFS/tests/testAppInitializer.py U Zope/trunk/src/webdav/tests/testPUT_factory.py -=- Modified: Zope/trunk/src/OFS/Application.py =================================================================== --- Zope/trunk/src/OFS/Application.py 2011-09-12 19:35:11 UTC (rev 122781) +++ Zope/trunk/src/OFS/Application.py 2011-09-12 19:45:23 UTC (rev 122782) @@ -213,6 +213,7 @@ self.install_inituser() self.install_products() self.install_standards() + self.install_virtual_hosting() def install_cp_and_products(self): global APP_MANAGER @@ -266,6 +267,16 @@ transaction.get().note('Migrated user folder') transaction.commit() + def install_virtual_hosting(self): + app = self.getApp() + if 'virtual_hosting' not in app: + from Products.SiteAccess.VirtualHostMonster \ + import VirtualHostMonster + vhm = VirtualHostMonster() + vhm.id = 'virtual_hosting' + vhm.addToContainer(app) + self.commit('Added virtual_hosting') + def install_products(self): return install_products() Modified: Zope/trunk/src/OFS/tests/testAppInitializer.py =================================================================== --- Zope/trunk/src/OFS/tests/testAppInitializer.py 2011-09-12 19:35:11 UTC (rev 122781) +++ Zope/trunk/src/OFS/tests/testAppInitializer.py 2011-09-12 19:45:23 UTC (rev 122782) @@ -99,6 +99,15 @@ self.assertTrue(hasattr(app, 'Control_Panel')) self.assertEqual(app.Control_Panel.meta_type, 'Control Panel') + def test_install_virtual_hosting(self): + self.configure(good_cfg) + i = self.getOne() + i.install_virtual_hosting() + app = i.getApp() + self.assertTrue('virtual_hosting' in app) + self.assertEqual( + app.virtual_hosting.meta_type, 'Virtual Host Monster') + def test_install_required_roles(self): self.configure(good_cfg) i = self.getOne() Modified: Zope/trunk/src/webdav/tests/testPUT_factory.py =================================================================== --- Zope/trunk/src/webdav/tests/testPUT_factory.py 2011-09-12 19:35:11 UTC (rev 122781) +++ Zope/trunk/src/webdav/tests/testPUT_factory.py 2011-09-12 19:45:23 UTC (rev 122782) @@ -21,8 +21,9 @@ self.app.manage_addFolder('folder', '') self.folder = self.app.folder # Setup VHM - vhm = VirtualHostMonster() - vhm.addToContainer(self.app) + if 'virtual_hosting' not in self.app: + vhm = VirtualHostMonster() + vhm.addToContainer(self.app) # Fake a WebDAV PUT request request = self.app.REQUEST request['PARENTS'] = [self.app] _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org https://mail.zope.org/mailman/listinfo/zope-checkins