Ticket #14876: 14876.r16622.diff
File 14876.r16622.diff, 1.4 KB (added by , 13 years ago) |
---|
-
django/db/models/sql/query.py
1102 1102 table = table_it.next() 1103 1103 if join == table and self.alias_refcount[join] > 1: 1104 1104 continue 1105 join_promote = self.promote_alias(join )1105 join_promote = self.promote_alias(join, unconditional=True) 1106 1106 if table != join: 1107 1107 table_promote = self.promote_alias(table) 1108 1108 break -
tests/regressiontests/queries/tests.py
966 966 Report.objects.create(name='r2', creator=a3) 967 967 Report.objects.create(name='r3') 968 968 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 969 974 def test_ticket7095(self): 970 975 # Updates that are filtered on the model being updated are somewhat 971 976 # tricky in MySQL. This exercises that case.