def test_add_queries(self):
    ContentType.objects.get_for_model(self.food_model)
    apple = self.food_model.objects.create(name='apple')
    queries = 22
    if (django.VERSION < (1, 6)):
        queries -= 12
    self.assertNumQueries(queries, apple.tags.add, 'red', 'delicious', 'green')
    pear = self.food_model.objects.create(name='pear')
    queries = 9
    if (django.VERSION < (1, 6)):
        queries -= 4
    self.assertNumQueries(queries, pear.tags.add, 'green', 'delicious')
    self.assertNumQueries(0, pear.tags.add)
def test_add_queries(self):
    ContentType.objects.get_for_model(self.food_model)
    apple = self.food_model.objects.create(name='apple')
    queries = 22
    if (django.VERSION < (1, 6)):
        queries -= 12
    self.assertNumQueries(queries, apple.tags.add, 'red', 'delicious', 'green')
    pear = self.food_model.objects.create(name='pear')
    queries = 9
    if (django.VERSION < (1, 6)):
        queries -= 4
    self.assertNumQueries(queries, pear.tags.add, 'green', 'delicious')
    self.assertNumQueries(0, pear.tags.add)