#20779 closed Bug (fixed)
document AdminSite.app_index_template
Reported by: | Collin Anderson | Owned by: | Susan Tan |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Collin Anderson | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
it was added back in #8498 but it's not anywhere in the docs:
it should be added here:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-attributes
and maybe here too:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#root-and-login-templates
Change History (11)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
https://github.com/django/django/pull/1412 Feel free to review. Thanks.
comment:4 by , 11 years ago
What I meant was that app_index_template
was added in [0511435a33], but without a test. I would take a look at the CustomModelAdminTest
in tests/admin_views/tests.py
. That class includes tests for the custom login and index templates. I think the test for a custom app index template would be similar and could be added there.
comment:5 by , 11 years ago
Thanks Tim for pointing out the relevant test case. I've made a new test, called " testCustomAdminSiteAppIndexViewandTemplate", as you can see in the above PR. But the new test fails. Below is the stack trace of the error. I'll really appreciate any help in debugging; I'm stuck.
FAIL: testCustomAdminSiteAppIndexViewandTemplate (admin_views.tests.CustomModelAdminTest)
Traceback (most recent call last):
File "/../django/tests/admin_views/tests.py", line 815, in testCustomAdminSiteAppIndexViewandTemplate
self.assertTemplateUsed(response, 'custom_admin/app_index.html')
File "/../django/django/test/testcases.py", line 526, in assertTemplateUsed
(template_name, ', '.join(template_names)))
AssertionError: Template 'custom_admin/app_index.html' was not a template used to render the response. Actual template(s) used: custom_admin/index.html, admin/index.html, admin/base_site.html, admin/base.html
Ran 211 tests in 39.752s
FAILED (failures=1, skipped=3)
comment:6 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
follow-up: 10 comment:9 by , 11 years ago
Thanks Susan, I was able to get the test working, see ccf8f1e18f138dae369a2004c83db9704ad52d99.
comment:10 by , 11 years ago
Replying to timo:
Thanks Susan, I was able to get the test working, see ccf8f1e18f138dae369a2004c83db9704ad52d99.
Ah! I see, thanks for the correction, Tim.
It would be nice to add a test for the feature as well.