Opened 12 years ago

Closed 12 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 12 years ago.
Proposed patch against trunk
17499-2.diff (2.2 KB ) - added by Claude Paroz 12 years ago.
Same patch with test

Download all attachments as: .zip

Change History (5)

by dpifke, 12 years ago

Attachment: assertfieldoutput.patch added

Proposed patch against trunk

comment:1 by Julien Phalip, 12 years ago

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.

by Claude Paroz, 12 years ago

Attachment: 17499-2.diff added

Same patch with test

comment:2 by Claude Paroz, 12 years ago

Cc: claude@… added
Needs tests: unset

comment:3 by Aymeric Augustin, 12 years ago

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