aboutsummaryrefslogtreecommitdiff
path: root/test_utils/managers/contest/conftest.py
blob: b29cf180a876b94e011f037667f03aa46a13bdcf (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
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest

from generalresearch.managers.base import Permission
from generalresearch.managers.thl.contest_manager import ContestManager

if TYPE_CHECKING:
    from generalresearch.pg_helper import PostgresConfig


@pytest.fixture(scope="session")
def contest_manager(thl_web_rw: PostgresConfig) -> ContestManager:
    assert thl_web_rw.dsn
    assert thl_web_rw.dsn.path
    assert "/unittest-" in thl_web_rw.dsn.path

    return ContestManager(
        pg_config=thl_web_rw,
        permissions=[
            Permission.CREATE,
            Permission.READ,
            Permission.UPDATE,
            Permission.DELETE,
        ],
    )