Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#15550 closed (fixed)

Some model form doctests fail on Postgresql

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

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>


Change History (5)

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

In [15745]:

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

comment:2 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

In [15753]:

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

comment:4 by Russell Keith-Magee, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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