Opened 3 years ago

Closed 2 years ago

#22369 closed New feature (fixed)

Add ability to assert number of times a template is used for assertTemplateUsed

Reported by: anonymous Owned by: Jake Rothenbuhler
Component: Testing framework Version: master
Severity: Normal Keywords: assert, testing
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

For instance, using django-autocomplete-light a template from this package is used for each field where you define as an autocomplete field. It'd be nice can check for the times the template is used:

SimpleTestCase.assertTemplateUsed(response, template_name, count=1, msg_prefix=)

Change History (5)

comment:1 Changed 2 years ago by Tim Graham

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Summary: Times a template is used using assertTemplateUsedAdd ability to assert number of times a template is used for assertTemplateUsed
Triage Stage: UnreviewedAccepted
Version: 1.6master

comment:2 Changed 2 years ago by Jake Rothenbuhler

Owner: changed from nobody to Jake Rothenbuhler
Status: newassigned

comment:3 Changed 2 years ago by Jake Rothenbuhler

Has patch: set

comment:4 Changed 2 years ago by Simon Charette

Patch needs improvement: set

comment:5 Changed 2 years ago by Simon Charette <charette.s@…>

Resolution: fixed
Status: assignedclosed

In 17c18844561431aabed89c3bd48de951db7d13ab:

Fixed #22369 -- Added count parameter to assertTemplateUsed

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