Django command to generate test case for rest apis.
Project description
TestCaseGenerator for Django REST APIs
django_rest_test_case_generator is a Python library that helps developers automatically generate test cases for their
Django REST Framework APIs. It crawls through the project, detects class-based views (CBVs), and creates
corresponding test cases based on the HTTP methods (GET, POST, PUT, DELETE, etc.) defined in those views.
This saves developers time and ensures that their API endpoints are well-covered by automated tests.
Getting Started
These instructions will help you to set up the library on your working project and start generating test cases for development and testing purposes.
Prerequisites
Before you can use django_rest_test_case_generator, you'll need to have the following installed:
pip install django djangorestframework
django-admin startproject myproject
cd myproject
Installation
Now, you can install this package.
pip install django-rest-test-case-generator
In your Django project, add the test_case_generator_command app to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
# Other apps
'test_case_generator_command',
]
Now you're ready to generate test cases for your APIs. Use the following management command to crawl through your project and create the test cases:
python manage.py generate_test_case
This will scan for class-based views (CBVs) and generate corresponding test cases for each API method (GET, POST, PUT, DELETE).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_rest_test_case_generator-0.2.1.tar.gz.
File metadata
- Download URL: django_rest_test_case_generator-0.2.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed516fc44c512beed81664aefab1a99e33ef21cc9459e3e431fe0b26c392f192
|
|
| MD5 |
b5c023b6d7a23caf3e907f1839e52575
|
|
| BLAKE2b-256 |
efdb6158c45efe8136317fc51ead40652be2bd00fac399db18587f0fc2826a39
|
File details
Details for the file django_rest_test_case_generator-0.2.1-py3-none-any.whl.
File metadata
- Download URL: django_rest_test_case_generator-0.2.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3195009ddb129b527e5f5c53c3f8ded8f6dcb13c2a5d47110be7b0089fa1e50f
|
|
| MD5 |
5884dabdf2d8886d73702099be92696b
|
|
| BLAKE2b-256 |
7c7ca54b356e144266f22fe33ce66b2f505fda5b12447a44b8a2e8e613a076da
|