Esempio n. 1
0
from httpx import AsyncClient
from pytest_lazyfixture import lazy_fixture

from joj.horse import apis
from joj.horse.models.permission import DefaultRole
from joj.horse.models.user import User
from joj.horse.tests.utils.utils import (
    create_test_user,
    do_api_request,
    get_base_url,
    user_access_tokens,
    user_refresh_tokens,
    validate_response,
)

base_auth_url = get_base_url(apis.auth)
base_user_url = get_base_url(apis.user)
base_domain_url = get_base_url(apis.domains)
# base_problems_url = get_base_url(apis.problems)


@pytest.mark.asyncio
@pytest.mark.depends(name="TestAuthRegister", on="TestUtils")
class TestAuthRegister:
    @pytest.mark.parametrize(
        "username",
        [
            "global_root_user",
            "global_domain_root_user",
            "global_domain_user",
            "global_guest_user",
Esempio n. 2
0
import pytest

from joj.horse import apis, models
from joj.horse.tests.utils.utils import get_base_url, parametrize_global_problems

base_user_url = get_base_url(apis.user)


@pytest.mark.asyncio
@pytest.mark.depends(name="TestProblemCreate", on=["TestProblemSetCreate"])
class TestProblemCreate:
    @parametrize_global_problems
    async def test_global_problems(self, problem: models.Problem) -> None:
        pass