Code

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#3164 closed defect (fixed)

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

Reported by: Matt Boersma <mboersma@…> Owned by: adrian
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@…> 7 years ago.
Adds ordering = ("pub_date",) to basic models.py

Download all attachments as: .zip

Change History (7)

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

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

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

  • Summary changed from "basic" model tests assume ORDER BY id to [patch] "basic" model tests assume ORDER BY id

comment:2 Changed 7 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 7 years ago by bouldersprinters

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

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

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:5 Changed 7 years ago by russellm

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

(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 7 years ago by anonymous

  • milestone Version 1.0 deleted

Milestone Version 1.0 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.