def test_query_traverse(self): spot = self.pet_model.objects.create(name="Spot") spike = self.pet_model.objects.create(name="Spike") spot.tags.add("scary") spike.tags.add("fluffy") lookup_kwargs = {"%s__name" % _model_name(self.pet_model): "Spot"} self.assert_tags_equal(self.tag_model.objects.filter(**lookup_kwargs), ["scary"])
def test_query_traverse(self): spot = self.pet_model.objects.create(name='Spot') spike = self.pet_model.objects.create(name='Spike') spot.tags.add('scary') spike.tags.add('fluffy') lookup_kwargs = {'%s__name' % _model_name(self.pet_model): 'Spot'} self.assert_tags_equal(self.tag_model.objects.filter(**lookup_kwargs), ['scary'])
def test_query_traverse(self): spot = self.pet_model.objects.create(name='Spot') spike = self.pet_model.objects.create(name='Spike') spot.tags.add('scary') spike.tags.add('fluffy') lookup_kwargs = { '%s__name' % _model_name(self.pet_model): 'Spot' } self.assert_tags_equal( self.tag_model.objects.filter(**lookup_kwargs), ['scary'] )