def assert_tags_equal(self, qs, tags, sort=True, attr='name'):
    got = [getattr(obj, attr) for obj in qs]
    if sort:
        got.sort()
        tags.sort()
    self.assertEqual(got, tags)
def assert_tags_equal(self, qs, tags, sort=True, attr='name'):
    got = [getattr(obj, attr) for obj in qs]
    if sort:
        got.sort()
        tags.sort()
    self.assertEqual(got, tags)