Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15550 closed (fixed)

Some model form doctests fail on Postgresql

Reported by: bberes Owned by: nobody
Component: Forms Version: master
Severity: Keywords: postgresql blocker
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

======================================================================
FAIL: API_TESTS (modeltests.model_forms.models.__test__)
Doctest: modeltests.model_forms.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/botondus/Envs/django/lib/python2.6/site-packages/django/test/_doctest.py", line 2180, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for modeltests.model_forms.models.__test__.API_TESTS
  File "/home/botondus/Envs/django/django/tests/modeltests/model_forms/models.py", line unknown line number, in API_TESTS

----------------------------------------------------------------------
File "/home/botondus/Envs/django/django/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS
Failed example:
    print f.as_ul()
Expected:
    <li>Headline: <input type="text" name="headline" maxlength="50" /></li>
    <li>Slug: <input type="text" name="slug" maxlength="50" /></li>
    <li>Pub date: <input type="text" name="pub_date" /></li>
    <li>Writer: <select name="writer">
    <option value="" selected="selected">---------</option>
    <option value="...">Mike Royko</option>
    <option value="...">Bob Woodward</option>
    <option value="...">Carl Bernstein</option>
    </select></li>
    <li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
    <li>Status: <select name="status">
    <option value="" selected="selected">---------</option>
    <option value="1">Draft</option>
    <option value="2">Pending</option>
    <option value="3">Live</option>
    </select></li>
    <li>Categories: <select multiple="multiple" name="categories">
    <option value="1">Entertainment</option>
    <option value="2">It&#39;s a test</option>
    <option value="3">Third</option>
    <option value="4">Fourth</option>
    </select> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></li>
Got:
    <li>Headline: <input type="text" name="headline" maxlength="50" /></li>
    <li>Slug: <input type="text" name="slug" maxlength="50" /></li>
    <li>Pub date: <input type="text" name="pub_date" /></li>
    <li>Writer: <select name="writer">
    <option value="" selected="selected">---------</option>
    <option value="13">Mike Royko</option>
    <option value="15">Carl Bernstein</option>
    <option value="14">Bob Woodward</option>
    </select></li>
    <li>Article: <textarea rows="10" cols="40" name="article"></textarea></li>
    <li>Status: <select name="status">
    <option value="" selected="selected">---------</option>
    <option value="1">Draft</option>
    <option value="2">Pending</option>
    <option value="3">Live</option>
    </select></li>
    <li>Categories: <select multiple="multiple" name="categories">
    <option value="1">Entertainment</option>
    <option value="2">It&#39;s a test</option>
    <option value="3">Third</option>
    <option value="4">Fourth</option>
    </select> <span class="helptext"> Hold down "Control", or "Command" on a Mac, to select more than one.</span></li>
----------------------------------------------------------------------
File "/home/botondus/Envs/django/django/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS
Failed example:
    print form.as_p()
Expected:
    <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
    <option value="" selected="selected">---------</option>
    <option value="...">Mike Royko</option>
    <option value="...">Bob Woodward</option>
    <option value="...">Carl Bernstein</option>
    <option value="...">Joe Better</option>
    </select></p>
    <p><label for="id_age">Age:</label> <input type="text" name="age" id="id_age" /></p>
Got:
    <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
    <option value="" selected="selected">---------</option>
    <option value="13">Mike Royko</option>
    <option value="15">Carl Bernstein</option>
    <option value="14">Bob Woodward</option>
    <option value="16">Joe Better</option>
    </select></p>
    <p><label for="id_age">Age:</label> <input type="text" name="age" id="id_age" /></p>
----------------------------------------------------------------------
File "/home/botondus/Envs/django/django/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS
Failed example:
    print form.as_p()
Expected:
    <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
    <option value="">---------</option>
    <option value="...">Mike Royko</option>
    <option value="..." selected="selected">Bob Woodward</option>
    <option value="...">Carl Bernstein</option>
    <option value="...">Joe Better</option>
    </select></p>
    <p><label for="id_age">Age:</label> <input type="text" name="age" value="65" id="id_age" /></p>
Got:
    <p><label for="id_writer">Writer:</label> <select name="writer" id="id_writer">
    <option value="">---------</option>
    <option value="13">Mike Royko</option>
    <option value="15">Carl Bernstein</option>
    <option value="14" selected="selected">Bob Woodward</option>
    <option value="16">Joe Better</option>
    </select></p>
    <p><label for="id_age">Age:</label> <input type="text" name="age" value="65" id="id_age" /></p>
----------------------------------------------------------------------
File "/home/botondus/Envs/django/django/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS
Failed example:
    print form['parent']
Expected:
    <select name="parent" id="id_parent">
    <option value="">---------</option>
    <option value="86" selected="selected">Apple</option>
    <option value="22">Pear</option>
    <option value="87">Core</option>
    </select>
Got:
    <select name="parent" id="id_parent">
    <option value="">---------</option>
    <option value="22">Pear</option>
    <option value="86" selected="selected">Apple</option>
    <option value="87">Core</option>
    </select>


Attachments (0)

Change History (5)

comment:1 Changed 3 years ago by russellm

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

In [15745]:

Fixed #15550 -- Corrected an ordering dependency in the model_forms doctests. Thanks to bberes for the report.

comment:2 Changed 3 years ago by russellm

In [15748]:

[1.2.X] Fixed #15550 -- Corrected an ordering dependency in the model_forms doctests. Thanks to bberes for the report.

Backport of r15745 from trunk.

comment:3 Changed 3 years ago by russellm

In [15753]:

Refs #15550 -- Corrected another primary-key ordering problem in the modelforms tests. Thanks to bberes for the report.

comment:4 Changed 3 years ago by russellm

In [15754]:

[1.2.X] Refs #15550 -- Corrected another primary-key ordering problem in the modelforms tests. Thanks to bberes for the report.

Backport of r15753 from trunk.

comment:5 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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.