Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#17954 closed Bug (fixed)

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

Reported by: lrekucki 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 claudep 3 years ago.
Patch from pull request (+ one wrapped line)
setup_databases.patch (1019 bytes) - added by simonpercivall 2 years ago.
fix dependency problem when one db is an alias for 'default'

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by ramiro

  • Summary changed from django.test.simple.dependency_order() allows cyclic dependencies between aliases. to django.test.simple.dependency_ordered() allows cyclic dependencies between aliases.
  • Triage Stage changed from Unreviewed to Accepted

Changed 3 years ago by claudep

Patch from pull request (+ one wrapped line)

comment:2 Changed 3 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

Looks good.

comment:3 Changed 3 years ago by claudep

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

In [17931]:

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

comment:4 Changed 2 years ago by simonpercivall

  • Resolution fixed deleted
  • Status changed from closed to new

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

comment:5 Changed 2 years ago by carljm

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

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 2 years ago by simonpercivall

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

comment:6 Changed 2 years ago by simonpercivall

Will do.

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