def test_extra_fields(self):
    self.tag_model.objects.create(name='red')
    self.tag_model.objects.create(name='delicious', official=True)
    apple = self.food_model.objects.create(name='apple')
    apple.tags.add('delicious', 'red')
    pear = self.food_model.objects.create(name='Pear')
    pear.tags.add('delicious')
    self.assertEqual(apple, self.food_model.objects.get(tags__official=False))
def test_extra_fields(self):
    self.tag_model.objects.create(name='red')
    self.tag_model.objects.create(name='delicious', official=True)
    apple = self.food_model.objects.create(name='apple')
    apple.tags.add('delicious', 'red')
    pear = self.food_model.objects.create(name='Pear')
    pear.tags.add('delicious')
    self.assertEqual(apple, self.food_model.objects.get(tags__official=False))