update test for url_for and update routing.md doc

This commit is contained in:
lixxu
2017-02-14 10:26:30 +08:00
parent fb419eaa36
commit 4839ede64f
3 changed files with 47 additions and 25 deletions

View File

@@ -283,10 +283,9 @@ class Sanic:
replacement_regex, supplied_param, out)
# parse the remainder of the keyword arguments into a querystring
if kwargs:
query_string = urlencode(kwargs, doseq=True)
# scheme://netloc/path;parameters?query#fragment
out = urlunparse((scheme, netloc, out, '', query_string, anchor))
query_string = urlencode(kwargs, doseq=True) if kwargs else ''
# scheme://netloc/path;parameters?query#fragment
out = urlunparse((scheme, netloc, out, '', query_string, anchor))
return out