Changeset View
Changeset View
Standalone View
Standalone View
swh/web/tests/conftest.py
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
# Alias rf fixture from pytest-django | # Alias rf fixture from pytest-django | ||||
@pytest.fixture | @pytest.fixture | ||||
def request_factory(rf): | def request_factory(rf): | ||||
return rf | return rf | ||||
# Fixture to get test client from Django REST Framework | # Fixture to get test client from Django REST Framework | ||||
@pytest.fixture(scope="module") | @pytest.fixture | ||||
def api_client(): | def api_client(): | ||||
return APIClient() | return APIClient() | ||||
# Fixture to get API request factory from Django REST Framework | # Fixture to get API request factory from Django REST Framework | ||||
@pytest.fixture(scope="module") | @pytest.fixture | ||||
def api_request_factory(): | def api_request_factory(): | ||||
return APIRequestFactory() | return APIRequestFactory() | ||||
# Initialize tests data | # Initialize tests data | ||||
@pytest.fixture(scope="session", autouse=True) | @pytest.fixture(scope="session", autouse=True) | ||||
def tests_data(): | def tests_data(): | ||||
data = get_tests_data(reset=True) | data = get_tests_data(reset=True) | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |