Example #1
0
def admin_client():
    admin = UserFactory(
        username='******',
        name='Admin',
        phone='+15005551212',
        is_active=True,
        is_admin=True,
    )
    client = Client()
    client.force_login(admin)
    return client
Example #2
0
def admin_client():
    admin = UserFactory(
        username='******',
        name='Admin',
        email='admin@localhost',
        is_active=True,
        is_admin=True,
    )
    client = Client()
    client.force_login(admin)
    return client
Example #3
0
def user_client():
    user = UserFactory(
        username='******',
        name='User',
        phone='+15005551212',
        is_active=True,
        is_admin=False,
    )
    client = Client()
    client.force_login(user)
    return client
Example #4
0
def user_client():
    user = UserFactory(
        username='******',
        name='User',
        email='user@localhost',
        is_active=True,
        is_admin=False,
    )
    client = Client()
    client.force_login(user)
    return client