Code

Opened 12 months ago

Closed 11 months ago

Last modified 11 months ago

#20779 closed Bug (fixed)

document AdminSite.app_index_template

Reported by: CollinAnderson Owned by: susan
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: CollinAnderson Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Attachments (0)

Change History (11)

comment:1 Changed 12 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

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

comment:2 Changed 12 months ago by susan

  • Owner changed from nobody to susan
  • Status changed from new to assigned

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

comment:3 Changed 12 months ago by susan

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

comment:4 Changed 12 months ago 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.

comment:5 Changed 11 months ago 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)

Version 0, edited 11 months ago by susan (next)

comment:6 Changed 11 months ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7de35a9ef372eb47442d5d1278cc15b6155e5054:

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

Thanks CollinAnderson for the report.

comment:8 Changed 11 months ago by Tim Graham <timograham@…>

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 Changed 11 months ago by Tim Graham <timograham@…>

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 Changed 11 months ago by Tim Graham <timograham@…>

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 follow-up: Changed 11 months ago by timo

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

comment:10 in reply to: ↑ 9 Changed 11 months ago by susan

Replying to timo:

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

Ah! I see, thanks for the correction, Tim.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.