#14772: Reversing a URL with optional arguments fails ----------------------------+----------------------------------------------- Reporter: robhudson | Owner: nobody Status: new | Milestone: Component: Core framework | Version: 1.2 Keywords: reverse | Stage: Unreviewed Has_patch: 0 | ----------------------------+----------------------------------------------- I discovered this recently where I wanted a URL to be /detail/ for page 1, and /detail/page-2/ for further pages. I set up the "page-2/" as an optional regular expression and my default had a default kwarg. Reversing this URL without the page worked but not when I added the page argument. So I created some test cases and found some interesting results...
The first test case without the '$' terminated URL, results in: `AssertionError: '/optional/1/2' != '/optional/1/2/'` With the '$' terminated URL, it results in an exception, which is what I was triggering in my project, it seems: AssertionError: '/optional/1/2/' != <class 'django.core.urlresolvers.NoReverseMatch'> I'll attach the testing changes... -- Ticket URL: <http://code.djangoproject.com/ticket/14772> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.