Commit 359613a7 authored by Hanno Schlichting's avatar Hanno Schlichting

Revert part of c122071 and always get a VHM back

parent f4da03d4
...@@ -213,6 +213,7 @@ class AppInitializer: ...@@ -213,6 +213,7 @@ class AppInitializer:
self.install_inituser() self.install_inituser()
self.install_products() self.install_products()
self.install_standards() self.install_standards()
self.install_virtual_hosting()
def install_cp_and_products(self): def install_cp_and_products(self):
global APP_MANAGER global APP_MANAGER
...@@ -266,6 +267,16 @@ class AppInitializer: ...@@ -266,6 +267,16 @@ class AppInitializer:
transaction.get().note('Migrated user folder') transaction.get().note('Migrated user folder')
transaction.commit() 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): def install_products(self):
return install_products() return install_products()
......
...@@ -99,6 +99,15 @@ class TestInitialization( unittest.TestCase ): ...@@ -99,6 +99,15 @@ class TestInitialization( unittest.TestCase ):
self.assertTrue(hasattr(app, 'Control_Panel')) self.assertTrue(hasattr(app, 'Control_Panel'))
self.assertEqual(app.Control_Panel.meta_type, '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): def test_install_required_roles(self):
self.configure(good_cfg) self.configure(good_cfg)
i = self.getOne() i = self.getOne()
......
...@@ -21,8 +21,9 @@ class TestPUTFactory(unittest.TestCase): ...@@ -21,8 +21,9 @@ class TestPUTFactory(unittest.TestCase):
self.app.manage_addFolder('folder', '') self.app.manage_addFolder('folder', '')
self.folder = self.app.folder self.folder = self.app.folder
# Setup VHM # Setup VHM
vhm = VirtualHostMonster() if 'virtual_hosting' not in self.app:
vhm.addToContainer(self.app) vhm = VirtualHostMonster()
vhm.addToContainer(self.app)
# Fake a WebDAV PUT request # Fake a WebDAV PUT request
request = self.app.REQUEST request = self.app.REQUEST
request['PARENTS'] = [self.app] request['PARENTS'] = [self.app]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment