Sort the URL's query string parameters.
(url)
| 534 | """ |
| 535 | |
| 536 | def normalize(url): |
| 537 | """Sort the URL's query string parameters.""" |
| 538 | url = str(url) # Coerce reverse_lazy() URLs. |
| 539 | scheme, netloc, path, query, fragment = urlsplit(url) |
| 540 | query_parts = sorted(parse_qsl(query)) |
| 541 | return urlunsplit((scheme, netloc, path, urlencode(query_parts), fragment)) |
| 542 | |
| 543 | if msg_prefix: |
| 544 | msg_prefix += ": " |
no test coverage detected