Commit 39d64c1c authored by Tres Seaver's avatar Tres Seaver

Fix Products.Sessions test.

Borked during merge of Products.PloneHotfix20131210 fixes.
parent e2159b6d
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
Test suite for session id manager. Test suite for session id manager.
""" """
import unittest import unittest
import Testing import Testing.ZopeTestCase
class TestBrowserIdManager(unittest.TestCase): class TestBrowserIdManager(unittest.TestCase):
...@@ -646,13 +646,14 @@ class TestBrowserIdManagerTraverser(unittest.TestCase): ...@@ -646,13 +646,14 @@ class TestBrowserIdManagerTraverser(unittest.TestCase):
class TestBrowserIdManagerPublish(Testing.ZopeTestCase.FunctionalTestCase): class TestBrowserIdManagerPublish(Testing.ZopeTestCase.FunctionalTestCase):
def test_encodeUrl_safe(self): def test_encodeUrl_safe(self):
from OFS.Application import AppInitializer from Products.Sessions.BrowserIdManager import BrowserIdManager
init = AppInitializer(self.app) if not hasattr(self.app, 'browser_id_manager'):
init.install_browser_id_manager() bid = BrowserIdManager('browser_id_manager', 'Browser Id Manager')
self.app._setObject('browser_id_manager', bid)
res = self.publish( res = self.publish(
'/browser_id_manager/encodeUrl?url=%3Chtml%3EEVIL%2Fhtml%3E%3C!--') '/browser_id_manager/encodeUrl?url=%3Chtml%3EEVIL%2Fhtml%3E%3C!--')
self.assertNotIn("<html>EVIL/html>", res.getBody()) self.assertFalse("<html>EVIL/html>" in res.getBody())
class DummyObject: class DummyObject:
......
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