Opened 5 years ago

Closed 5 years ago

#17499 closed Bug (fixed)

assertFieldOutput fails if field has customized required message

Reported by: dpifke Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Release blocker Keywords:
Cc: claude@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The string u'This field is required.' is hard-coded into the field checks in SimpleTestCase.assertFieldOutput(). This causes tests using this method to always fail for fields which have customized default_error_messages.

Proposed fix would be to use the string from the field's error_messages dictionary instead; one-line patch to do so forthcoming.

Attachments (2)

assertfieldoutput.patch (1.0 KB) - added by dpifke 5 years ago.
Proposed patch against trunk
17499-2.diff (2.2 KB) - added by Claude Paroz 5 years ago.
Same patch with test

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by dpifke

Attachment: assertfieldoutput.patch added

Proposed patch against trunk

comment:1 Changed 5 years ago by Julien Phalip

Needs tests: set
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Thank you for the report. Could you please provide some tests?
Marking as release blocker since it's a new feature in 1.4.

Changed 5 years ago by Claude Paroz

Attachment: 17499-2.diff added

Same patch with test

comment:2 Changed 5 years ago by Claude Paroz

Cc: claude@… added
Needs tests: unset

comment:3 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

In [17345]:

Fixed #17499 -- Ensured assertFieldOutput works for fields that customize the "required" error message. Thanks dpifke for the report and patch, and claudep for the tests.

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