You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

63 lines
1.3 KiB

import pytest
from factories.users import UserFactory, AccountFactory
@pytest.fixture
def user_staff():
"""
Create user as staff with data:
email = 'admin@example.com'
password = 'test'
is_staff=True
is_active = True
is_superuser = True
"""
admin = UserFactory(
last_name='Иванов',
first_name='Иван',
email='admin@example.com',
is_staff=True,
is_active=True,
is_superuser=True
)
AccountFactory(owner=admin)
return admin
@pytest.fixture
def user_student():
"""
Create user as student with data:
email = 'student@example.com'
password = 'test'
is_active = True
"""
student = UserFactory(
last_name='Иванов',
first_name='Иван',
email='student@example.com',
is_staff=False,
is_active=True,
)
AccountFactory(owner=student)
return student
@pytest.fixture
def user_not_active_student():
"""
Create user as student with data:
email = 'notactivestudent@example.com'
password = 'test'
is_active = False
"""
student = UserFactory(
last_name='Иванов',
first_name='Иван',
email='notactivestudent@example.com',
is_staff=False,
is_active=False,
)
return student