'DRY helper.'

def check_permissions(self, group_name, permission_codenames):

    self.assertEqual(set(permission_codenames), {p.codename for p in Group.objects.get(name=group_name).permissions.all()})
