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
--
Ticket URL: <https://code.djangoproject.com/ticket/20779>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* type: Uncategorized => Bug
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
It would be nice to add a test for the feature as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:1>
* status: new => assigned
* owner: nobody => susan
Comment:
https://github.com/django/django/pull/1412 Feel free to review. Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:2>
Comment (by susan):
I'm new to testing. How should I add a test for this new feature?
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:3>
Comment (by timo):
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:4>
Comment (by susan):
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)
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"7de35a9ef372eb47442d5d1278cc15b6155e5054"]:
{{{
#!CommitTicketReference repository=""
revision="7de35a9ef372eb47442d5d1278cc15b6155e5054"
Fixed #20779 -- Documented AdminSite.app_index_template; refs #8498.
Thanks CollinAnderson for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"ed6ec47ff72f5597d53f8c3e3ccd9ba13c360d4e"]:
{{{
#!CommitTicketReference repository=""
revision="ed6ec47ff72f5597d53f8c3e3ccd9ba13c360d4e"
[1.4.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs
#8498.
Thanks CollinAnderson for the report.
Backport of 7de35a9ef3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"bc617fd42c660c87f5fb6ba43c7b78449c4997d7"]:
{{{
#!CommitTicketReference repository=""
revision="bc617fd42c660c87f5fb6ba43c7b78449c4997d7"
[1.6.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs
#8498.
Thanks CollinAnderson for the report.
Backport of 7de35a9ef3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"72fb37f9fdf0397e7e67856b28fc5f1f4546b57b"]:
{{{
#!CommitTicketReference repository=""
revision="72fb37f9fdf0397e7e67856b28fc5f1f4546b57b"
[1.5.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs
#8498.
Thanks CollinAnderson for the report.
Backport of 7de35a9ef3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:8>
Comment (by timo):
Thanks Susan, I was able to get the test working, see
ccf8f1e18f138dae369a2004c83db9704ad52d99.
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:9>
Comment (by susan):
Replying to [comment:9 timo]:
> Thanks Susan, I was able to get the test working, see
ccf8f1e18f138dae369a2004c83db9704ad52d99.
Ah! I see, thanks for the correction, Tim.
--
Ticket URL: <https://code.djangoproject.com/ticket/20779#comment:10>