blob: ed8477b50095229345f4b306533cf029c6e45950 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
from __future__ import annotations
from collections.abc import Callable
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from generalresearch.models.thl.product import Product
from generalresearch.models.thl.user import User
class TestContest:
"""In many of the Contest related tests, we often want a consistent
Product throughout, and multiple different users that may be
involved in the Contest... so redefine the product fixture along with
some users in here that are scoped="class" so they stay around for
each of the test functions
"""
@pytest.fixture(scope="function")
def user_1(self, user_factory: Callable[..., User], product: Product) -> User:
return user_factory(product=product)
@pytest.fixture(scope="function")
def user_2(self, user_factory: Callable[..., User], product: Product) -> User:
return user_factory(product=product)
@pytest.fixture(scope="function")
def user_3(self, user_factory: Callable[..., User], product: Product) -> User:
return user_factory(product=product)
|