Re: Custom urlconfs in django.contrib.auth tests failing when reverse is used in templates
On Fri, May 22, 2009 at 3:08 AM, Andrew Fongwrote: > > Figured this out somewhat: To get around this, you can do something > like this when referencing external apps in auth templates: > > {% url project.other_app.views.other_view as view %} > > This won't raise an error if that reference doesn't work. > > Still, this feels a bit hackish. I think brittle auth tests are > something of a recurring theme here. "Brittle" is perhaps a little extreme, but yes, there are issues. All I can say in our defence is that the Django test suite passes for us, and passes on a wide range of projects on which we use Django. However, there are use cases that we don't exercise - which leads to reports like yours. If you open a ticket describing the problem you are having (and, in this case, the workaround for people that experience the same problem), we can look at addressing this in the future. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Custom urlconfs in django.contrib.auth tests failing when reverse is used in templates
Figured this out somewhat: To get around this, you can do something like this when referencing external apps in auth templates: {% url project.other_app.views.other_view as view %} This won't raise an error if that reference doesn't work. Still, this feels a bit hackish. I think brittle auth tests are something of a recurring theme here. On May 20, 5:18 pm, Andrew Fongwrote: > I have the contrib.auth app installed, and in order for its tests to > pass, I have to define certain registration templates. When defining > those templates, if I use the url tag / reverse to point to a view > outside the auths app, the auth tests fail. > > This occurs because the auth tests use a custom urlconf and have no > knowledge of views elsewhere in the project -- on one hand, this makes > sense since the auth app shouldn't be expected to know about the URLs > in the project it's included in. > > On the other hand, the auth app invites us to write its own template > -- and it seems reasonable that the template used for a login page > might also have a link to another page in the app. For example, my > registration templates extend a base template that has a nav bar > pointing to views in other apps. > > Any ideas on how to work around this? > > -- Andrew --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---