<gh_stars>0
from django.contrib.auth import get_user_model

from papermerge.core.models import Document

User = get_user_model()


def create_root_user():
    user = User.objects.create_user(
        'admin',
        '<EMAIL>',
        is_active=True,
        is_superuser=True,
    )
    user.save()

    return user


def create_margaret_user():
    user = User.objects.create_user(
        'margaret',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_elizabet_user():
    user = User.objects.create_user(
        'elizabet',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_uploader_user():
    user = User.objects.create_user(
        'uploader',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_some_doc(
    user,
    page_count=2,
    parent_id=None
):
    """
    Returns a (newly created) document instance.
    Title, file_name, size, language do not matter.
    """
    doc = Document.objects.create_document(
        title="document_A",
        file_name="document_A.pdf",
        size='36',
        lang='DEU',
        user=user,
        page_count=page_count,
        parent_id=parent_id
    )

    return doc

from django.contrib.auth import get_user_model

from papermerge.core.models import Document

User = get_user_model()


def create_root_user():
    user = User.objects.create_user(
        'admin',
        '<EMAIL>',
        is_active=True,
        is_superuser=True,
    )
    user.save()

    return user


def create_margaret_user():
    user = User.objects.create_user(
        'margaret',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_elizabet_user():
    user = User.objects.create_user(
        'elizabet',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_uploader_user():
    user = User.objects.create_user(
        'uploader',
        '<EMAIL>',
        is_active=True,
    )
    user.save()

    return user


def create_some_doc(
    user,
    page_count=2,
    parent_id=None
):
    """
    Returns a (newly created) document instance.
    Title, file_name, size, language do not matter.
    """
    doc = Document.objects.create_document(
        title="document_A",
        file_name="document_A.pdf",
        size='36',
        lang='DEU',
        user=user,
        page_count=page_count,
        parent_id=parent_id
    )

    return doc
Returns a (newly created) document instance.     Title, file_name, size, language do not matter.