def tearDown(self): Tag.objects.all().delete() Place.objects.all().delete() Thing.objects.all().delete() TagFactory.reset_sequence() PlaceFactory.reset_sequence() ThingFactory.reset_sequence()
def test_place_taggable_some_tags(self): place = PlaceFactory() place.tags.add(TagFactory()) place.tags.add(TagFactory()) place.tags.add(TagFactory()) tags = place.get_tag_names() self.assertEqual(3, tags.count()) tag_list = list(tags) self.assertEqual(['tag1', 'tag2', 'tag3'], tag_list)
def test_place_taggable_no_tags(self): place = PlaceFactory() tags = place.get_tag_names() self.assertEqual(0, tags.count())