#3164 closed defect (fixed)
[patch] "basic" model tests assume ORDER BY id
Reported by: | 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)
Change History (7)
by , 18 years ago
Attachment: | basic_order_by.diff added |
---|
comment:1 by , 18 years ago
Summary: | "basic" model tests assume ORDER BY id → [patch] "basic" model tests assume ORDER BY id |
---|
comment:2 by , 18 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 , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 18 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Reopened, since it is not yet fixed in the main trunk, only the oracle branch.
comment:5 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Adds ordering = ("pub_date",) to basic models.py