add tests for licenses rest api

This commit is contained in:
Andreas Zweili 2020-11-30 18:04:49 +01:00
parent c48e18d7d7
commit 2e28f2bca1
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import pytest
from django.urls import reverse
@pytest.mark.django_db
def test_unauthorized_request_user_license(api_client):
url = reverse('user-license-list')
response = api_client.get(url)
assert response.status_code == 403
@pytest.mark.django_db
def test_unauthorized_request_computer_license(api_client):
url = reverse('computer-license-list')
response = api_client.get(url)
assert response.status_code == 403
@pytest.mark.django_db
def test_unauthorized_request_license_with_user(api_client):
url = reverse('license-with-user-list')
response = api_client.get(url)
assert response.status_code == 403
@pytest.mark.django_db
def test_unauthorized_request_license_with_computer(api_client):
url = reverse('license-with-computer-list')
response = api_client.get(url)
assert response.status_code == 403