mirror of
https://github.com/Nebucatnetzer/network_inventory.git
synced 2024-06-24 08:26:43 +02:00
add tests for backup REST API
This commit is contained in:
parent
ccbcce3551
commit
1ffa5cb110
31
backend/backups/tests/test_views.py
Normal file
31
backend/backups/tests/test_views.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
import pytest
|
||||
|
||||
from django.urls import reverse
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_unauthorized_request_backup_method(api_client):
|
||||
url = reverse('backup-method-list')
|
||||
response = api_client.get(url)
|
||||
assert response.status_code == 403
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_unauthorized_request_backup(api_client):
|
||||
url = reverse('backup-list')
|
||||
response = api_client.get(url)
|
||||
assert response.status_code == 403
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_unauthorized_request_target_device(api_client):
|
||||
url = reverse('target-device-list')
|
||||
response = api_client.get(url)
|
||||
assert response.status_code == 403
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_unauthorized_request_notificaton_from_backup(api_client):
|
||||
url = reverse('notification-from-backup-list')
|
||||
response = api_client.get(url)
|
||||
assert response.status_code == 403
|
Loading…
Reference in New Issue
Block a user