Commit eda5d21a authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web] Allow Static Web Section to also handle the redirect

parent 450e3622
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>name, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>StaticWebSection_getDocumentValue</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -35,10 +35,10 @@ import ssl
LOCATION = "Location"
WEB_SITE_ID = "bouncer"
class TestStaticWebSectionRedirection(ERP5TypeTestCase):
class TestStaticWebSiteRedirection(ERP5TypeTestCase):
def getTitle(self):
return "Test Static Web Section Redirection."
return "Test Static Web Site Redirection."
def getBusinessTemplateList(self):
return (
......@@ -182,3 +182,35 @@ class TestStaticWebSectionRedirection(ERP5TypeTestCase):
def test_302queryStringRedirectFolderDeepNested(self):
self.runTestRedirect("foo/bar/baz?baz=bam&cous=cous&amp;the=end", use_moved_temporarily=1)
class TestStaticWebSectionRedirection(TestStaticWebSiteRedirection):
def getTitle(self):
return "Test Static Web Section Redirection."
def setupWebSite(self, use_moved_temporarily=None, **kw):
"""
Setup Web Site
"""
if WEB_SITE_ID in self.portal.web_site_module.objectIds():
self.portal.web_site_module.manage_delObjects(WEB_SITE_ID)
website = self.portal.web_site_module.newContent(
portal_type="Web Site",
id=WEB_SITE_ID
)
websection = website.newContent(
portal_type="Static Web Section",
id='foobarsection',
layout_configuration_form_id="StaticWebSite_viewRedirectAssistConfiguration",
skin_selection_name="RedirectAssist",
custom_render_method_id="StaticWebSite_getRedirectSourceUrl",
redirect_domain="https://www.example.org",
use_moved_temporarily=use_moved_temporarily or 0,
**kw
)
website.publish()
self.tic()
return websection
......@@ -43,7 +43,11 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
<tuple>
<string>W: 91, 28: Unused variable \'api_path\' (unused-variable)</string>
<string>W: 91, 16: Unused variable \'api_netloc\' (unused-variable)</string>
<string>W: 91, 4: Unused variable \'api_scheme\' (unused-variable)</string>
</tuple>
</value>
</item>
<item>
......
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