Code

Opened 2 years ago

Closed 17 months ago

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 2 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 2 years ago by claudep

Patch from pull request (+ one wrapped line)

comment:2 Changed 2 years ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

Looks good.

comment:3 Changed 2 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 17 months 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 17 months 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 17 months ago by simonpercivall

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

comment:6 Changed 17 months ago by simonpercivall

Will do.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.