Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#3164 closed defect (fixed)

[patch] "basic" model tests assume ORDER BY id

Reported by: Matt Boersma <mboersma@…> Owned by: Adrian Holovaty
Component: Testing framework Version: dev
Severity: normal Keywords: oracle, ordering
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As discussed on django-dev, the tests/modeltests/basic/models.py contains doctests that OR together other query sets, then expect the results to be in a deterministic order, apparently by id. But no ordering is specified in the model, so the tests are passing only by luck (and they fail against the Oracle backend).

We need a patch to add ordering = ("-pub_date",) and to alter the relevant tests to match that ordering.

Attachments (1)

basic_order_by.diff (493 bytes ) - added by Matt Boersma <mboersma@…> 17 years ago.
Adds ordering = ("pub_date",) to basic models.py

Download all attachments as: .zip

Change History (7)

by Matt Boersma <mboersma@…>, 17 years ago

Attachment: basic_order_by.diff added

Adds ordering = ("pub_date",) to basic models.py

comment:1 by Matt Boersma <mboersma@…>, 17 years ago

Summary: "basic" model tests assume ORDER BY id[patch] "basic" model tests assume ORDER BY id

comment:2 by Matt Boersma <mboersma@…>, 17 years ago

Tested against Postgres, MySQL, and sqlite in SVN revision 4226, and against Oracle in the boulder-oracle-sprint branch. Seems to fix the problem and match the intent of the tests.

comment:3 by Matt Boersma, 17 years ago

Resolution: fixed
Status: newclosed

(In [4227]) boulder-oracle-sprint: Fixed #3164 in branch since it made basic unit tests
fail.

comment:4 by Matt Boersma <mboersma@…>, 17 years ago

Resolution: fixed
Status: closedreopened

Reopened, since it is not yet fixed in the main trunk, only the oracle branch.

comment:5 by Russell Keith-Magee, 17 years ago

Resolution: fixed
Status: reopenedclosed

(In [4228]) Fixed #3164 -- Added explicit ordering to basic model test, and revised results to suit the explicit order. Thanks to Matt Boersma for the report.

comment:6 by (none), 17 years ago

milestone: Version 1.0

Milestone Version 1.0 deleted

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