Opened 14 years ago
Closed 14 years ago
#17173 closed New feature (fixed)
Add a unit test for reverse('namespace:name') -> URL with special regexp chars.
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The last test in this patch fails on 1.3.1 but works on HEAD, and I noticed no other test for it.
Summary of the failure (1.3.1):
If the left part of an include contains special chars in regard to re, using the namespace:name form of reverse() will return a URL with the escape characters left in.
AssertionError: '/+%5C$*/included/normal/' != '/%5C+%5C%5C%5C$%5C*/included/normal/'
Attached are two patches: one for SVN HEAD, the other for 1.3.1, if you want to reproduce the failure.
Patch against SVN HEAD. Adds a few unittests for urlpatterns_reverse