Opened 14 years ago

Closed 14 years ago

#14247 closed (fixed)

[regression in 1.2.2] 'forms' test failure in 1.2.X

Reported by: Ramiro Morales Owned by: nobody
Component: Testing framework Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As discussed with pmclanaham on #django-dev, additionally to #14245 this (test suite, no critical) failure also exist in 1.2.2 as of now:

======================================================================
FAIL: Initial instances for model fields may also be instances (refs #7287)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/p/django/1.2.2/tests/regressiontests/forms/models.py", line 160, in test_initial_instance_value
    <input type="hidden" name="initial-multi_choice_int" value="3" id="initial-id_multi_choice_int_1" /> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></p>""")
AssertionError: u'<p><label for="id_choice">Choice:</label> <select name="choice" id="id_choice">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-choice" value="2" id="initial-id_choice" /></p>\n<p><label for="id_choice_int">Choice int:</label> <select name="choice_int" id="id_choice_int">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-choice_int" value="2" id="initial-id_choice_int" /></p>\n<p><label for="id_multi_choice">Multi choice:</label> <select multiple="multiple" name="multi_choice" id="id_multi_choice">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3" selected="selected">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-multi_choice" value="2" id="initial-id_multi_choice_0" />\n<input type="hidden" name="initial-multi_choice" value="3" id="initial-id_multi_choice_1" />  Hold down "Control", or "Command" on a Mac, to select more than one.</p>\n<p><label for="id_multi_choice_int">Multi choice int:</label> <select multiple="multiple" name="multi_choice_int" id="id_multi_choice_int">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3" selected="selected">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-multi_choice_int" value="2" id="initial-id_multi_choice_int_0" />\n<input type="hidden" name="initial-multi_choice_int" value="3" id="initial-id_multi_choice_int_1" />  Hold down "Control", or "Command" on a Mac, to select more than one.</p>' != '<p><label for="id_choice">Choice:</label> <select name="choice" id="id_choice">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-choice" value="2" id="initial-id_choice" /></p>\n<p><label for="id_choice_int">Choice int:</label> <select name="choice_int" id="id_choice_int">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-choice_int" value="2" id="initial-id_choice_int" /></p>\n<p><label for="id_multi_choice">Multi choice:</label> <select multiple="multiple" name="multi_choice" id="id_multi_choice">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3" selected="selected">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-multi_choice" value="2" id="initial-id_multi_choice_0" />\n<input type="hidden" name="initial-multi_choice" value="3" id="initial-id_multi_choice_1" /> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></p>\n<p><label for="id_multi_choice_int">Multi choice int:</label> <select multiple="multiple" name="multi_choice_int" id="id_multi_choice_int">\n<option value="1">ChoiceOption 1</option>\n<option value="2" selected="selected">ChoiceOption 2</option>\n<option value="3" selected="selected">ChoiceOption 3</option>\n</select><input type="hidden" name="initial-multi_choice_int" value="2" id="initial-id_multi_choice_int_0" />\n<input type="hidden" name="initial-multi_choice_int" value="3" id="initial-id_multi_choice_int_1" /> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></p>'

It seems it is simply a rendered form output that doesn't match the expected one. One of the reasons seems to be an string/Unicode mismatch and the other
is this one:

http://paste.pocoo.org/show/260082/

The expected output was introduced in [13578] when backporting [13577] by blindly copying it from trunk, it contains a helptext span that is present there but not in 1.2.X (see r13519/r13522).

Change History (1)

comment:1 by Luke Plant, 14 years ago

Resolution: fixed
Status: newclosed

(In [13707]) [1.2.X] Fixed #14247 - 'forms' test failure in 1.2.X

Thanks to ramiro/pmclanaham for the report and analysis.

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