mirror of
https://github.com/Nebucatnetzer/network_inventory.git
synced 2024-07-08 17:04:13 +02:00
32 lines
825 B
Python
32 lines
825 B
Python
import pytest
|
|
|
|
from django.urls import reverse
|
|
|
|
|
|
@pytest.mark.django_db
|
|
def test_unauthorized_request_ip_status(api_client):
|
|
url = reverse('ipstatus-list')
|
|
response = api_client.get(url)
|
|
assert response.status_code == 403
|
|
|
|
|
|
@pytest.mark.django_db
|
|
def test_authorized_request_ip_status(api_client_authenticated):
|
|
url = reverse('ipstatus-list')
|
|
response = api_client_authenticated.get(url)
|
|
assert response.status_code == 200
|
|
|
|
|
|
@pytest.mark.django_db
|
|
def test_unauthorized_request_net(api_client):
|
|
url = reverse('net-list')
|
|
response = api_client.get(url)
|
|
assert response.status_code == 403
|
|
|
|
|
|
@pytest.mark.django_db
|
|
def test_authorized_request_net(api_client_authenticated):
|
|
url = reverse('net-list')
|
|
response = api_client_authenticated.get(url)
|
|
assert response.status_code == 200
|