#15294: Use named urls instead of hard coded ones in admin views ---------------------------------------+------------------------------- Reporter: julien | Owner: ramiro Type: New feature | Status: new Milestone: | Component: contrib.admin Version: SVN | Severity: Normal Resolution: | Keywords: Triage Stage: Accepted | Has patch: 1 Needs documentation: 1 | Needs tests: 0 Patch needs improvement: 1 | Easy pickings: 0 UI/UX: 0 | ---------------------------------------+------------------------------- Changes (by julien):
* needs_better_patch: 0 => 1 Comment: Great effort cleaning up the admin tests! It looks sane and much more in line with best practices. It seems to fix the errors that Ramiro had (and which I finally managed to see too) but I'm now getting 2 failures: {{{ ====================================================================== FAIL: testAddView (regressiontests.admin_views.tests.AdminViewPermissionsTest) Test add view restricts access and actually adds items. ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/julien/Documents/Development/eclipse/workspace/DjangoCore/git/tests/regressiontests/admin_views/tests.py", line 863, in testAddView 'Unrestricted user is not given link to change list view in breadcrumbs.') AssertionError: True is not False : Unrestricted user is not given link to change list view in breadcrumbs. ====================================================================== FAIL: test_save_as_display (regressiontests.admin_views.tests.SaveAsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/julien/Documents/Development/eclipse/workspace/DjangoCore/git/tests/regressiontests/admin_views/tests.py", line 600, in test_save_as_display self.assertEqual(response.context['form_url'], '/test_admin/admin/admin_views/person/add/') AssertionError: '../add/' != '/test_admin/admin/admin_views/person/add/' }}} Also, I've got a slight preference for `admin_url_name` instead of `admin_url` simply because that filter does not return a url. Another approach could be a new template tag: `{% admin_url opts 'changelist' %}` -- It would feel more natural to me, since it's an admin-specific thing. I'm not too precious about this though. Apart from that, I think it's getting really close now! :-) -- Ticket URL: <https://code.djangoproject.com/ticket/15294#comment:33> Django <https://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-updates@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.