comparison test/test_actions.py @ 5164:114d9628fd77

Fixed a couple of failing tests for *LoginRedirect in test_actions.py after url validation. Also raise ValueError from examine_url if base url is None.
author John Rouillard <rouilj@ieee.org>
date Sat, 23 Jul 2016 17:21:14 -0400
parents 894aa07be6cb
children 198b6e810c67
comparison
equal deleted inserted replaced
5163:6ae426092d7d 5164:114d9628fd77
21 self.client.add_error_message = lambda x : add_message( 21 self.client.add_error_message = lambda x : add_message(
22 self.client._error_message, x) 22 self.client._error_message, x)
23 self.client.add_ok_message = lambda x : add_message( 23 self.client.add_ok_message = lambda x : add_message(
24 self.client._ok_message, x) 24 self.client._ok_message, x)
25 self.client.form = self.form 25 self.client.form = self.form
26 self.client.base = "http://whoami.com/path/"
26 class TemplatingUtils: 27 class TemplatingUtils:
27 pass 28 pass
28 self.client.instance.interfaces.TemplatingUtils = TemplatingUtils 29 self.client.instance.interfaces.TemplatingUtils = TemplatingUtils
29 30
30 class ShowActionTestCase(ActionTestCase): 31 class ShowActionTestCase(ActionTestCase):
321 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255", 322 self.assertLoginRaisesRedirect("http://whoami.com/path/issue255",
322 'foo', 'right', "http://whoami.com/path/issue255") 323 'foo', 'right', "http://whoami.com/path/issue255")
323 324
324 # test if we are logged out; should kill the @action=logout 325 # test if we are logged out; should kill the @action=logout
325 self.form.value[:] = [] # clear out last test's setup values 326 self.form.value[:] = [] # clear out last test's setup values
326 self.assertLoginRaisesRedirect("http://localhost:9017/demo/issue39?%40startwith=0&%40pagesize=50", 327 self.assertLoginRaisesRedirect("http://whoami.com/path/issue39?%40startwith=0&%40pagesize=50",
327 'foo', 'right', "http://localhost:9017/demo/issue39?@action=logout&@pagesize=50&@startwith=0") 328 'foo', 'right', "http://whoami.com/path/issue39?@action=logout&@pagesize=50&@startwith=0")
328 329
329 def testInvalidLoginRedirect(self): 330 def testInvalidLoginRedirect(self):
330 self.client.db.security.hasPermission = lambda *args, **kwargs: True 331 self.client.db.security.hasPermission = lambda *args, **kwargs: True
331 332
332 def opendb(username): 333 def opendb(username):

Roundup Issue Tracker: http://roundup-tracker.org/