Risking this question to be too generic...
What would be the advised use case types to test in a regular implementation of a REST API using the djangorestframework plugin?
Risking this question to be too generic...
What would be the advised use case types to test in a regular implementation of a REST API using the djangorestframework plugin?
I don't know that I understand your question very well,
Code without tests is broken as designed.
So each part of an application need test. you should test the functionality of each API with unit-test, and fortunately, Django rest framework has tools for this action
http://www.django-rest-framework.org/api-guide/testing/
from django.urls import include, path, reverse
from rest_framework.test import APITestCase, URLPatternsTestCase
class AccountTests(APITestCase, URLPatternsTestCase):
urlpatterns = [
path('api/', include('api.urls')),
]
def test_create_account(self):
"""
Ensure we can create a new account object.
"""
url = reverse('account-list')
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(len(response.data), 1)