add a test for the weekday api

This commit is contained in:
Andreas Zweili 2020-11-28 11:14:58 +01:00
parent 21a116fbea
commit 10c7ed4558
2 changed files with 16 additions and 0 deletions

View File

@ -36,3 +36,9 @@ def create_admin_user():
result['group'] = group
return result
return _create_admin_user
@pytest.fixture
def api_client():
from rest_framework.test import APIClient
return APIClient()

10
core/tests/test_rest.py Normal file
View File

@ -0,0 +1,10 @@
import pytest
from django.urls import reverse
@pytest.mark.django_db
def test_unauthorized_request(api_client):
url = reverse('weekday-list')
response = api_client.get(url)
assert response.status_code == 403