django-rest-framework-supertest

A set of utilities to test django-rest-framework API's


Keywords
django, api, rest_framework
License
MIT
Install
pip install django-rest-framework-supertest==0.0.2

Documentation

django-rest-framework-supertest

An WORK IN PROGRESS set of utilities to write automated tests for APIS writen in django-rest-framework.

GitHub Workflow Status (with event) Coverage Status Ruff

Motivation

The django and django-rest-framework is an powerfull set of tools to create REST API's. But, testing these API', with automated tests, are a little more complex question. Write a lot of repeated code and the difficult to made all assertions along the REST API's responses is some of these problems for our apps.

This project wants to aggregate utilities to made assertions on the responses, like APIException responses, and utilities to work with other complex REST API's concepts, like pagination and authentication.

Under the Hood

Under the hood, this is only an set of utilities and this uses some libraries to work correctly. Actually, for fake data generation we use Faker, with some small custom provider's. For assertions, we use the default django and django-rest-framework unittest features. We provide some mixins with our own methods and some base classes.

Roadmap

  • Add Basic Faker Support
  • Assertions APIExceptions
  • Assert Validation Errors
  • Create Faker Shortcuts
  • Work with images and files
  • Assert Serializer Responses
  • Work with pagination
  • Work with multiple types of Authentication

This is an basic roadmap for the first version and, before the first version release, some new itens can be added here.