Metadata-Version: 2.1
Name: django-rest-framework-supertest
Version: 0.0.4
Summary: A set of utilities to test django-rest-framework API's
Author-email: Eduardo Oliveira <eduardo_y05@outlook.com>
Maintainer-email: Eduardo Oliveira <eduardo_y05@outlook.com>
License: MIT License
        
        Copyright (c) 2023 Eduardo José de Oliveira
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/inventare/django-rest-framework-supertest/
Project-URL: documentation, https://inventare.github.io/django-rest-framework-supertest/
Keywords: django,rest,rest_framework,drf,test
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Requires-Dist: djangorestframework
Requires-Dist: Faker
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Provides-Extra: image
Requires-Dist: Pillow; extra == "image"
Provides-Extra: jwt
Requires-Dist: djangorestframework-simplejwt; extra == "jwt"
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: coveralls; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-glightbox; extra == "docs"
Requires-Dist: mkdocs-awesome-pages-plugin; extra == "docs"

# django-rest-framework-supertest

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

<p align="center">
    <a href='https://github.com/inventare/django-rest-framework-supertest/actions/workflows/tests.yml'><img alt="GitHub Workflow Status (with event)" src="https://img.shields.io/github/actions/workflow/status/inventare/django-rest-framework-supertest/tests.yml?label=tests" /></a>
    <a href='https://coveralls.io/github/inventare/django-rest-framework-supertest?branch=main'><img src='https://coveralls.io/repos/github/inventare/django-rest-framework-supertest/badge.svg?branch=main' alt='Coverage Status' /></a>
    <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff" style="max-width:100%;"></a>
</p>

## 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](https://faker.readthedocs.io/en/master/index.html), 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

- [x] Add Basic Faker Support
- [x] Assertions APIExceptions
- [x] Assert Validation Errors
- [x] Create Faker Shortcuts
- [x] Work with images and files
- [x] 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.
