Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#17954 closed Bug (fixed)

django.test.simple.dependency_ordered() allows cyclic dependencies between aliases.

Reported by: Łukasz Rekucki Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

(This ticket is split from #17758)

The result of this functions depends on the order of aliases for given DB signature (which in turn depends on the order in settings.DATABASES dict) - i.e. if you have a DB with aliases ["A", "B"] and "A" depends on "B" then it will raise an error. If the alias list is ["B", "A"] it will pass.

Patch with tests provided in https://github.com/django/django/pull/131

Attachments (2)

17954.diff (5.6 KB ) - added by Claude Paroz 13 years ago.
Patch from pull request (+ one wrapped line)
setup_databases.patch (1019 bytes ) - added by Simon Percivall 12 years ago.
fix dependency problem when one db is an alias for 'default'

Download all attachments as: .zip

Change History (8)

comment:1 by Ramiro Morales, 13 years ago

Summary: django.test.simple.dependency_order() allows cyclic dependencies between aliases.django.test.simple.dependency_ordered() allows cyclic dependencies between aliases.
Triage Stage: UnreviewedAccepted

by Claude Paroz, 13 years ago

Attachment: 17954.diff added

Patch from pull request (+ one wrapped line)

comment:2 by Claude Paroz, 13 years ago

Triage Stage: AcceptedReady for checkin

Looks good.

comment:3 by Claude Paroz, 13 years ago

Resolution: fixed
Status: newclosed

In [17931]:

Fixed #17954 -- Fixed dependency checking for test databases. Thanks Łukasz Rekucki for the report and the patch.

comment:4 by Simon Percivall, 12 years ago

Resolution: fixed
Status: closednew

This code breaks badly if you have an alias for 'default'.

comment:5 by Carl Meyer, 12 years ago

Resolution: fixed
Status: newclosed

The issue described in this ticket was fixed, so it is correctly marked fixed. If the fix created a new issue, please open a new ticket with reproduction instructions and description (and link back to this ticket if that's helpful context). Thanks!

by Simon Percivall, 12 years ago

Attachment: setup_databases.patch added

fix dependency problem when one db is an alias for 'default'

comment:6 by Simon Percivall, 12 years ago

Will do.

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