Opened 10 years ago

Closed 10 years ago

Last modified 10 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: master
Severity: normal Keywords: oracle, ordering
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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@…> 10 years ago.
Adds ordering = ("pub_date",) to basic models.py

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Matt Boersma <mboersma@…>

Attachment: basic_order_by.diff added

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

comment:1 Changed 10 years ago by Matt Boersma <mboersma@…>

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

comment:2 Changed 10 years ago by Matt Boersma <mboersma@…>

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 Changed 10 years ago by Matt Boersma

Resolution: fixed
Status: newclosed

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

comment:4 Changed 10 years ago by Matt Boersma <mboersma@…>

Resolution: fixed
Status: closedreopened

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

comment:5 Changed 10 years ago by Russell Keith-Magee

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 Changed 10 years ago by (none)

milestone: Version 1.0

Milestone Version 1.0 deleted

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