Opened 5 years ago

Closed 4 years ago

Last modified 4 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 5 years ago.
Patch from pull request (+ one wrapped line)
setup_databases.patch (1019 bytes) - added by Simon Percivall 4 years ago.
fix dependency problem when one db is an alias for 'default'

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by Ramiro Morales

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

Changed 5 years ago by Claude Paroz

Attachment: 17954.diff added

Patch from pull request (+ one wrapped line)

comment:2 Changed 5 years ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

Looks good.

comment:3 Changed 5 years ago by Claude Paroz

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 Changed 4 years ago by Simon Percivall

Resolution: fixed
Status: closednew

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

comment:5 Changed 4 years ago by Carl Meyer

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!

Changed 4 years ago by Simon Percivall

Attachment: setup_databases.patch added

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

comment:6 Changed 4 years ago by Simon Percivall

Will do.

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