test(api): create api_client pytest fixture (#1990)
This commit is contained in:
parent
2b973b2695
commit
04c0b11901
1 changed files with 12 additions and 0 deletions
12
api/libretime_api/tests/conftest.py
Normal file
12
api/libretime_api/tests/conftest.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import pytest
|
||||
from django.conf import settings
|
||||
from rest_framework.test import APIClient
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def api_client():
|
||||
obj = APIClient()
|
||||
obj.credentials(
|
||||
HTTP_AUTHORIZATION=f"Api-Key {settings.CONFIG.general.api_key}",
|
||||
)
|
||||
return obj
|
Loading…
Add table
Add a link
Reference in a new issue