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


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 claudep 5 years ago.
Same patch with test

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by dpifke

Proposed patch against trunk

comment:1 Changed 5 years ago by julien

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to Accepted

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 claudep

Same patch with test

comment:2 Changed 5 years ago by claudep

  • Cc claude@… added
  • Needs tests unset

comment:3 Changed 5 years ago by aaugustin

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

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