Ticket #14876: 14876.r16622.diff

File 14876.r16622.diff, 1.4 KB (added by Johannes Dollinger, 13 years ago)

cleanup for r16622

  • django/db/models/sql/query.py

     
    11021102                table = table_it.next()
    11031103                if join == table and self.alias_refcount[join] > 1:
    11041104                    continue
    1105                 join_promote = self.promote_alias(join)
     1105                join_promote = self.promote_alias(join, unconditional=True)
    11061106                if table != join:
    11071107                    table_promote = self.promote_alias(table)
    11081108                break
  • tests/regressiontests/queries/tests.py

     
    966966        Report.objects.create(name='r2', creator=a3)
    967967        Report.objects.create(name='r3')
    968968
     969    def test_ticket14876(self):
     970        q1 = Report.objects.filter(Q(creator__isnull=True) | Q(creator__extra__info='e1'))
     971        q2 = Report.objects.filter(Q(creator__isnull=True)) | Report.objects.filter(Q(creator__extra__info='e1'))
     972        self.assertQuerysetEqual(q1, list(q2), lambda x: x)
     973
    969974    def test_ticket7095(self):
    970975        # Updates that are filtered on the model being updated are somewhat
    971976        # tricky in MySQL. This exercises that case.
Back to Top