Ticket #10977: 10977_test.diff
File 10977_test.diff, 965 bytes (added by , 13 years ago) |
---|
-
tests/regressiontests/queries/tests.py
1812 1812 2500 1813 1813 ) 1814 1814 1815 class UnionTests( unittest.TestCase):1815 class UnionTests(BaseQuerysetTest): 1816 1816 """ 1817 1817 Tests for the union of two querysets. Bug #12252. 1818 1818 """ … … 1870 1870 Q1 = Q(objecta__name='one', objectc__objecta__name='two') 1871 1871 Q2 = Q(objecta__objectc__name='ein', objectc__objecta__name='three', objecta__objectb__name='trois') 1872 1872 self.check_union(ObjectB, Q1, Q2) 1873 1874 def test_10977(self): 1875 qs1 = ObjectB.objects.all() 1876 qs2 = ObjectB.objects.filter( 1877 Q(objecta__objectc__name='ein') | 1878 Q(objecta__objectc__name='ein') 1879 ) 1880 1881 self.assertQuerysetEqual(qs1 & qs2, ['<ObjectB: trois>'])