'Tests QuerySet ORed combining in exclude subquery case.'

def test_ticket_20101(self):

    t = Tag.objects.create(name=u'foo')
    a1 = Annotation.objects.create(tag=t, name=u'a1')
    a2 = Annotation.objects.create(tag=t, name=u'a2')
    a3 = Annotation.objects.create(tag=t, name=u'a3')
    n = Note.objects.create(note=u'foo', misc=u'bar')
    qs1 = Note.objects.exclude(annotation__in=[a1, a2])
    qs2 = Note.objects.filter(annotation__in=[a3])
    self.assertTrue((n in qs1))
    self.assertFalse((n in qs2))
    self.assertTrue((n in (qs1 | qs2)))
