import pytest from django.urls import reverse @pytest.mark.django_db def test_unauthorized_request_backup_method(api_client): url = reverse('backupmethod-list') response = api_client.get(url) assert response.status_code == 403 @pytest.mark.django_db def test_authorized_request_backup_method(api_client_authenticatet): url = reverse('backupmethod-list') response = api_client_authenticatet.get(url) assert response.status_code == 200 @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_authorized_request_backup(api_client_authenticatet): url = reverse('backup-list') response = api_client_authenticatet.get(url) assert response.status_code == 200 @pytest.mark.django_db def test_unauthorized_request_target_device(api_client): url = reverse('targetdevice-list') response = api_client.get(url) assert response.status_code == 403 @pytest.mark.django_db def test_authorized_request_target_device(api_client_authenticatet): url = reverse('targetdevice-list') response = api_client_authenticatet.get(url) assert response.status_code == 200 @pytest.mark.django_db def test_unauthorized_request_notificaton_from_backup(api_client): url = reverse('notificationfrombackup-list') response = api_client.get(url) assert response.status_code == 403 @pytest.mark.django_db def test_authorized_request_notificaton_from_backup(api_client_authenticatet): url = reverse('notificationfrombackup-list') response = api_client_authenticatet.get(url) assert response.status_code == 200 @pytest.mark.django_db def test_unauthorized_request_notificaton(api_client): url = reverse('notification-list') response = api_client.get(url) assert response.status_code == 403 @pytest.mark.django_db def test_authorized_request_notificaton(api_client_authenticatet): url = reverse('notification-list') response = api_client_authenticatet.get(url) assert response.status_code == 200 @pytest.mark.django_db def test_unauthorized_request_notificaton_type(api_client): url = reverse('notificationtype-list') response = api_client.get(url) assert response.status_code == 403 @pytest.mark.django_db def test_authorized_request_notificaton_type(api_client_authenticatet): url = reverse('notificationtype-list') response = api_client_authenticatet.get(url) assert response.status_code == 200