test(api): create api_client pytest fixture (#1990)
This commit is contained in:
parent
2b973b2695
commit
04c0b11901
|
@ -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…
Reference in New Issue