'Setup a group for every grant on ACCESS TYPE'

def _setup_user_groups(self):

    userdata = [('user_1', True, self.GROUPNAME_1), ('user_1_nostaff', False, self.GROUPNAME_1), ('user_2', True, self.GROUPNAME_2), ('user_2_nostaff', False, self.GROUPNAME_2), ('user_3', True, self.GROUPNAME_3), ('user_3_nostaff', False, self.GROUPNAME_3), ('user_4', True, self.GROUPNAME_4), ('user_4_nostaff', False, self.GROUPNAME_4), ('user_5', True, self.GROUPNAME_5), ('user_5_nostaff', False, self.GROUPNAME_5), ('user_staff', True, None)]
    default_users_count = get_user_model().objects.all().count()
    for (username, is_staff, groupname) in userdata:
        user = self._create_user(username, is_staff)
        if groupname:
            (group, _) = Group.objects.get_or_create(name=groupname)
            user_set = getattr(group, 'user_set')
            user_set.add(user)
            group.save()
    self.assertEqual(11, (get_user_model().objects.all().count() - default_users_count))
