add a test for the weekday api
This commit is contained in:
parent
21a116fbea
commit
10c7ed4558
|
@ -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()
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue