Changeset 5191
- Timestamp:
- 08/21/08 20:33:37 (3 months ago)
- Files:
-
- branches/1.0/turbogears/controllers.py (modified) (1 diff)
- branches/1.0/turbogears/tests/test_controllers.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/turbogears/controllers.py
r5145 r5191 548 548 if isinstance(v, unicode): 549 549 v = v.encode('utf8') 550 args.append( '%s=%s' % (k, urllib.quote(str(v))))550 args.append((k, str(v))) 551 551 if args: 552 tgpath += '?' + '&'.join(args) 552 query_string = urllib.urlencode(args, True) 553 if '?' in tgpath: 554 tgpath += '&' + query_string 555 else: 556 tgpath += '?' + query_string 553 557 return tgpath 554 558 branches/1.0/turbogears/tests/test_controllers.py
r5145 r5191 678 678 ) == '/?foo=bar&foo=%C3%A0' 679 679 680 def test_existing_query_string(self): 681 """url() can handle URl with existing query string.""" 682 testutil.create_request("/") 683 test_url = url('/foo', {'first': 1}) 684 assert url(test_url, {'second': 2}) == '/foo?first=1&second=2' 685 680 686 def tearDown(self): 681 687 config.update({"server.webpath": ""})