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.
28 lines
626 B
28 lines
626 B
import pytest
|
|
from tests.client import BetterAPIClient
|
|
|
|
pytest_plugins = [
|
|
'tests.fixtures.users',
|
|
]
|
|
|
|
@pytest.fixture
|
|
def api_client():
|
|
"""Anonymous client for REST API."""
|
|
client = BetterAPIClient()
|
|
return client
|
|
|
|
|
|
@pytest.fixture
|
|
def staff_client(user_staff):
|
|
"""Authorized as staff client for REST API."""
|
|
client = BetterAPIClient()
|
|
client.force_authenticate(user=user_staff)
|
|
return client
|
|
|
|
|
|
@pytest.fixture
|
|
def student_client(user_student):
|
|
"""Authorized as staff client for REST API."""
|
|
client = BetterAPIClient()
|
|
client.force_authenticate(user=user_student)
|
|
return client
|
|
|