Ticket #7312: 7312.regressiontest.diff
File 7312.regressiontest.diff, 934 bytes (added by , 16 years ago) |
---|
-
tests/regressiontests/queries/models.py
134 134 def __unicode__(self): 135 135 return self.data 136 136 137 class CustomQ(object): 138 def __init__(self, *args, **kwargs): 139 self.args = args 140 self.kwargs = kwargs 141 def add_to_query(self, query, aliases): 142 query.add_q(Q(*self.args, **self.kwargs)) 137 143 138 144 __test__ = {'API_TESTS':""" 139 145 >>> t1 = Tag(name='t1') … … 701 707 >>> mm = ManagedModel.objects.create(data='mm1', tag=t1, is_public=True) 702 708 >>> ManagedModel.objects.update(data='mm') 703 709 710 Bug #7312 711 >>> Item.objects.complex_filter(CustomQ(tags=t1)).order_by('name') 712 [<Item: one>, <Item: two>] 713 >>> Item.objects.complex_filter(CustomQ(tags=t1)).filter(Q(tags=t2)) 714 [<Item: one>] 715 704 716 """}