Code

Opened 2 years ago

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

Download all attachments as: .zip

Change History (5)

Changed 2 years ago by dpifke

Proposed patch against trunk

comment:1 Changed 2 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 2 years ago by claudep

Same patch with test

comment:2 Changed 2 years ago by claudep

  • Cc claude@… added
  • Needs tests unset

comment:3 Changed 2 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.

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.