<commit_before>import pytest

from django.contrib.auth.models import Group, Permission

from . import factories


@pytest.fixture
def db_ready(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock() as db:
        return db


@pytest.fixture
def user(db_ready):
    return factories.UserFactory()


@pytest.fixture
def inactive_user(db_ready):
    return factories.UserFactory(is_active=False)


@pytest.fixture
def admin(db_ready):
    return factories.AdminFactory()


@pytest.fixture
def joker(db_ready):
    # return a user-like object nonexistant in db
    return factories.UserFactory.stub()


@pytest.fixture
def school_application_group(db_ready):
    # FIXME: c'est ce que je comprends de la fixture groups.json
    # FIXME: amha ça mériterais une migration
    perms = [
        'view_staff',
        'delete_staff',
        'add_itinerary',
        'change_itinerary',
        'delete_itinerary',
        'view_itinerary',
        'view_organizationtask',
        'delete_organizationtask',
        'add_production',
        'add_taggeditem',
        'change_taggeditem',
    ]

    group = Group.objects.create(name='School Application')
    group.permissions.set(Permission.objects.filter(codename__in=perms))
    return group<commit_msg>feat(conftest): align application group perms on production settings<commit_after>import pytest

from django.contrib.auth.models import Group, Permission

from . import factories


@pytest.fixture
def db_ready(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock() as db:
        return db


@pytest.fixture
def user(db_ready):
    return factories.UserFactory()


@pytest.fixture
def inactive_user(db_ready):
    return factories.UserFactory(is_active=False)


@pytest.fixture
def admin(db_ready):
    return factories.AdminFactory()


@pytest.fixture
def joker(db_ready):
    # return a user-like object nonexistant in db
    return factories.UserFactory.stub()


@pytest.fixture
def school_application_group(db_ready):
    # FIXME: amha ça mériterais une migration
    perms = [
        "add_corsmodel",
        "add_filmgenre",
        "add_gallery",
        "add_medium",
        "add_promotion",
        "add_stafftask",
        "add_student",
        "add_studentapplication",
        "add_studentapplicationsetup",
        "add_userobjectpermission",
        "change_corsmodel",
        "change_filmgenre",
        "change_gallery",
        "change_medium",
        "change_promotion",
        "change_stafftask",
        "change_student",
        "change_studentapplication",
        "change_studentapplicationsetup",
        "change_userobjectpermission",
        "delete_corsmodel",
        "delete_filmgenre",
        "delete_gallery",
        "delete_medium",
        "delete_promotion",
        "delete_student",
        "delete_studentapplication",
        "delete_studentapplicationsetup",
        "delete_userobjectpermission",
    ]

    group = Group.objects.create(name='School Application')
    group.permissions.set(Permission.objects.filter(codename__in=perms))
    return group
{'fraction_non_alphanumeric': 0.09355778569116219, 'fraction_numerical': 0.0, 'mean_word_length': 3.352112676056338, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5182133', 'n_tokens_mistral': 962, 'n_tokens_neox': 950, 'n_words': 182}