Ticket #10977: 10977_test.diff

File 10977_test.diff, 965 bytes (added by Philippe Raoult, 13 years ago)

test only vs trunk

  • tests/regressiontests/queries/tests.py

     
    18121812            2500
    18131813        )
    18141814
    1815 class UnionTests(unittest.TestCase):
     1815class UnionTests(BaseQuerysetTest):
    18161816    """
    18171817    Tests for the union of two querysets. Bug #12252.
    18181818    """
     
    18701870        Q1 = Q(objecta__name='one', objectc__objecta__name='two')
    18711871        Q2 = Q(objecta__objectc__name='ein', objectc__objecta__name='three', objecta__objectb__name='trois')
    18721872        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>'])
Back to Top