<reponame>notabela-org/project-1-photoshare-Hammadus
import uuid
import pytest


@pytest.fixture(scope='session')
def test_password():
    return str(uuid.uuid4())


@pytest.fixture
def create_user(db, django_user_model, test_password):
    def make_user(**kwargs):
        kwargs['password'] = <PASSWORD>
        if 'username' not in kwargs:
            kwargs['username'] = str(uuid.uuid4())

        return django_user_model.objects.create_user(**kwargs)
    return make_user


@pytest.fixture
def auto_login_user(db, client, create_user, test_password):
    def make_auto_login(user=None):
        if user is None:
            user = create_user()
        client.login(username=user.username, password=<PASSWORD>)
        return client, user
    return make_auto_login

import uuid
import pytest


@pytest.fixture(scope='session')
def test_password():
    return str(uuid.uuid4())


@pytest.fixture
def create_user(db, django_user_model, test_password):
    def make_user(**kwargs):
        kwargs['password'] = <PASSWORD>
        if 'username' not in kwargs:
            kwargs['username'] = str(uuid.uuid4())

        return django_user_model.objects.create_user(**kwargs)
    return make_user


@pytest.fixture
def auto_login_user(db, client, create_user, test_password):
    def make_auto_login(user=None):
        if user is None:
            user = create_user()
        client.login(username=user.username, password=<PASSWORD>)
        return client, user
    return make_auto_login