Commit 8221223b authored by Jérome Perrin's avatar Jérome Perrin

web: also set empty criterion as invalid on Web Site

For same reasons as on Web Sections: clicking the Contents tab search
for all documents
parent f1e7ea55
...@@ -10,3 +10,4 @@ localizer = context.getPortalObject().Localizer ...@@ -10,3 +10,4 @@ localizer = context.getPortalObject().Localizer
context.setAvailableLanguageSet(localizer.get_supported_languages()) context.setAvailableLanguageSet(localizer.get_supported_languages())
context.setDefaultAvailableLanguage(localizer.get_selected_language()) context.setDefaultAvailableLanguage(localizer.get_selected_language())
context.setStaticLanguageSelection(1) context.setStaticLanguageSelection(1)
context.setEmptyCriterionValid(False)
...@@ -43,8 +43,12 @@ class ShaCacheMixin(object): ...@@ -43,8 +43,12 @@ class ShaCacheMixin(object):
self.login() self.login()
self.portal = self.getPortal() self.portal = self.getPortal()
module = self.portal.web_site_module module = self.portal.web_site_module
self.shacache = module.newContent(portal_type='Web Site', self.shacache = module.newContent(
title='SHA Cache Server', skin_selection_name='SHACACHE') portal_type='Web Site',
title='SHA Cache Server',
skin_selection_name='SHACACHE',
empty_criterion_value=True,
)
self.shacache.publish() self.shacache.publish()
self.header_dict = { self.header_dict = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
......
...@@ -76,8 +76,12 @@ class ShaDirMixin(object): ...@@ -76,8 +76,12 @@ class ShaDirMixin(object):
} }
module = self.portal.web_site_module module = self.portal.web_site_module
self.shadir = module.newContent(portal_type='Web Site', self.shadir = module.newContent(
title='SHA Dir Server', skin_selection_name='SHADIR') portal_type='Web Site',
title='SHA Dir Server',
skin_selection_name='SHADIR',
empty_criterion_value=True,
)
self.shadir.publish() self.shadir.publish()
self.shadir_url = self.shadir.absolute_url() self.shadir_url = self.shadir.absolute_url()
self.tic() self.tic()
...@@ -250,8 +250,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase): ...@@ -250,8 +250,8 @@ class TestShaDir(ShaDirMixin, ERP5TypeTestCase):
def test_VirtualFolder_key(self): def test_VirtualFolder_key(self):
module = self.portal.newContent(portal_type='Folder', id='test_virtual_folder_%s' % random.random()) module = self.portal.newContent(portal_type='Folder', id='test_virtual_folder_%s' % random.random())
# WebSite is a VirtualFolder # WebSite is a VirtualFolder
vf1 = module.newContent(portal_type='Web Site') vf1 = module.newContent(portal_type='Web Site', empty_criterion_value=True)
vf2 = module.newContent(portal_type='Web Site') vf2 = module.newContent(portal_type='Web Site', empty_criterion_value=True)
obj_id = "test_obj_%s" % random.random() obj_id = "test_obj_%s" % random.random()
obj = vf1.newContent(portal_type='Web Section', id=obj_id) obj = vf1.newContent(portal_type='Web Section', id=obj_id)
self.assertEqual(obj, vf1._getOb(obj_id)) self.assertEqual(obj, vf1._getOb(obj_id))
......
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