Opened 6 years ago
Closed 6 years ago
#29920 closed Cleanup/optimization (fixed)
Add a test for smart_urlquote()'s UnicodeError branch
Reported by: | Hasan Ramezani | Owned by: | Hasan Ramezani |
---|---|---|---|
Component: | Testing framework | Version: | 2.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is a block in utils.html.smart_urlquote()
which There is no test coverage for except block:
try: netloc = netloc.encode('idna').decode('ascii') # IDN -> ACE except UnicodeError: # invalid domain part return unquote_quote(url)
we need to propose an example to cover the except block.
Change History (6)
comment:1 by , 6 years ago
Needs tests: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 6 years ago
comment:4 by , 6 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
comment:5 by , 6 years ago
Summary: | Test coverage for utils.html.smart_urlquote → Add a test for smart_urlquote()'s UnicodeError branch |
---|---|
Triage Stage: | Accepted → Ready for checkin |
For future reference, trivial patches to add additional test coverage don't require a ticket.
Note:
See TracTickets
for help on using tickets.
Fixed in the PR - https://github.com/django/django/pull/10614