Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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

Change History (11)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

It would be nice to add a test for the feature as well.

comment:2 by Susan Tan, 11 years ago

Owner: changed from nobody to Susan Tan
Status: newassigned

https://github.com/django/django/pull/1412 Feel free to review. Thanks.

comment:3 by Susan Tan, 11 years ago

I'm new to testing. How should I add a test for this new feature?

comment:4 by Tim Graham, 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 Susan Tan, 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)

Version 0, edited 11 years ago by Susan Tan (next)

comment:6 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 7de35a9ef372eb47442d5d1278cc15b6155e5054:

Fixed #20779 -- Documented AdminSite.app_index_template; refs #8498.

Thanks CollinAnderson for the report.

comment:8 by Tim Graham <timograham@…>, 11 years ago

In bc617fd42c660c87f5fb6ba43c7b78449c4997d7:

[1.6.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs #8498.

Thanks CollinAnderson for the report.

Backport of 7de35a9ef3 from master

comment:7 by Tim Graham <timograham@…>, 11 years ago

In ed6ec47ff72f5597d53f8c3e3ccd9ba13c360d4e:

[1.4.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs #8498.

Thanks CollinAnderson for the report.

Backport of 7de35a9ef3 from master

comment:8 by Tim Graham <timograham@…>, 11 years ago

In 72fb37f9fdf0397e7e67856b28fc5f1f4546b57b:

[1.5.x] Fixed #20779 -- Documented AdminSite.app_index_template; refs #8498.

Thanks CollinAnderson for the report.

Backport of 7de35a9ef3 from master

comment:9 by Tim Graham, 11 years ago

Thanks Susan, I was able to get the test working, see ccf8f1e18f138dae369a2004c83db9704ad52d99.

in reply to:  9 comment:10 by Susan Tan, 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.

Note: See TracTickets for help on using tickets.
Back to Top