def METHOD_NAME(role, *units):
    units_str = '_'.join(unit.name.lower() for unit in units)
    username = '{}-{}'.format(role.lower(), units_str)
    user = User.objects.create_user(
        username=username, password='password',
        first_name=role, last_name=units_str)
    if role == 'SU':
        user.is_superuser = True
        user.save()
    elif role == 'GA':
        user.is_staff = True
        user.is_general_admin = True
        user.save()
    elif role == 'UGA':
        user.is_staff = True
        for unit in units:
            user.unit_group_authorizations.create(
                subject=unit.unit_groups.first(),
                level=UnitGroupAuthorizationLevel.admin,
                authorized=user)
    elif role == 'UA':
        user.is_staff = True
        for unit in units:
            user.unit_authorizations.create(
                subject=unit,
                level=UnitAuthorizationLevel.admin,
                authorized=user)
    elif role == 'UM':
        user.is_staff = True
        for unit in units:
            user.unit_authorizations.create(
                subject=unit,
                level=UnitAuthorizationLevel.manager,
                authorized=user)
    elif role == 'N':
        pass
    elif role == 'A':
        user = AnonymousUser()
    else:  # pragma: no cover
        raise ValueError("Unknown role: {}".format(role))
    return user