-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconftest.py
More file actions
30 lines (20 loc) · 697 Bytes
/
conftest.py
File metadata and controls
30 lines (20 loc) · 697 Bytes
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
import pytest
from django.conf import settings
from openapi_documentor.users.models import User
from openapi_documentor.users.tests.factories import UserFactory
from openapi_documentor.openapi.tests.factories import DocumentFactory
open_api_file = settings.APPS_DIR / "openapi/tests/fixtures/hello.yaml"
with open(open_api_file) as fout:
open_api_doc = fout.read()
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> User:
return UserFactory()
@pytest.fixture
def document(openapi) -> User:
return DocumentFactory(doc=openapi)
@pytest.fixture
def openapi() -> str:
return open_api_doc