comparison test/test_templating.py @ 5156:882fa4d9bead

issue2550795: @dispname query args in page.html search links not valid html. Some queries with names that include spaces are not properly url encoded/quoted. I.E. a space should be replaced with %20. Fixes to allow a url_query method to be applied to HTMLStringProperty to properly quote string values passed as part of a url.
author John Rouillard <rouilj@ieee.org>
date Fri, 22 Jul 2016 15:48:57 -0400
parents e424987d294a
children ae2a5d1afdd5
comparison
equal deleted inserted replaced
5155:e1e3531b4d9b 5156:882fa4d9bead
101 ( issue = MockNull(getprops = lambda : dict(nosy = nosy)) 101 ( issue = MockNull(getprops = lambda : dict(nosy = nosy))
102 , user = MockNull(get = lambda id, name : id, lookup = lookup) 102 , user = MockNull(get = lambda id, name : id, lookup = lookup)
103 ) 103 )
104 cls = HTMLClass(self.client, "issue") 104 cls = HTMLClass(self.client, "issue")
105 cls["nosy"] 105 cls["nosy"]
106
107 def test_string_url_quote(self):
108 ''' test that urlquote quotes the string '''
109 p = StringHTMLProperty(self.client, 'test', '1', None, 'test', 'test string< foo@bar')
110 self.assertEqual(p.url_quote(), 'test%20string%3C%20foo%40bar')
106 111
107 def test_url_match(self): 112 def test_url_match(self):
108 '''Test the URL regular expression in StringHTMLProperty. 113 '''Test the URL regular expression in StringHTMLProperty.
109 ''' 114 '''
110 def t(s, nothing=False, **groups): 115 def t(s, nothing=False, **groups):

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