Django

Code

Ticket #3164 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: Matt Boersma <mboersma@arraybiopharma.com> Assigned to: adrian
Milestone: Component: Unit test system
Version: SVN Keywords: oracle, ordering
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

basic_order_by.diff (493 bytes) - added by Matt Boersma <mboersma@arraybiopharma.com> on 12/18/06 11:21:14.
Adds ordering = ("pub_date",) to basic models.py

Change History

12/18/06 11:21:14 changed by Matt Boersma <mboersma@arraybiopharma.com>

  • attachment basic_order_by.diff added.

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

12/18/06 11:22:13 changed by Matt Boersma <mboersma@arraybiopharma.com>

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

12/18/06 11:23:39 changed by Matt Boersma <mboersma@arraybiopharma.com>

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.

12/18/06 11:36:02 changed by bouldersprinters

  • status changed from new to closed.
  • resolution set to fixed.

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

12/18/06 11:37:06 changed by Matt Boersma <mboersma@arraybiopharma.com>

  • status changed from closed to reopened.
  • resolution deleted.

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

12/18/06 21:38:39 changed by russellm

  • status changed from reopened to closed.
  • resolution set to fixed.

(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.

01/17/07 16:12:17 changed by

  • milestone deleted.

Milestone Version 1.0 deleted


Add/Change #3164 ([patch] "basic" model tests assume ORDER BY id)




Change Properties
Action