# 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).
Raw data
{
"_id": null,
"home_page": "https://github.com/Ronakjain515/django-rest-test-case-generator",
"name": "django-rest-test-case-generator",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "django, test case generator, rest apis, testing",
"author": "Ronak Jain",
"author_email": "jronak515@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7a/da/d1fc963a2edd9d1fb265fb347ddfd976eec9022ea58e395d4826eb934ee1/django_rest_test_case_generator-0.1.1.tar.gz",
"platform": null,
"description": "# TestCaseGenerator for Django REST APIs\n`django_rest_test_case_generator` is a Python library that helps developers automatically generate test cases for their \nDjango REST Framework APIs. It crawls through the project, detects class-based views (CBVs), and creates \ncorresponding test cases based on the HTTP methods (GET, POST, PUT, DELETE, etc.) defined in those views. \nThis saves developers time and ensures that their API endpoints are well-covered by automated tests.\n\n## Getting Started\nThese instructions will help you to set up the library on your working project and start generating test cases\nfor development and testing purposes.\n\n### Prerequisites\nBefore you can use `django_rest_test_case_generator`, you'll need to have the following installed:\n\n```\npip install django djangorestframework\ndjango-admin startproject myproject\ncd myproject\n```\n\n### Installation\n\nNow, you can install this package.\n\n```\npip install django-rest-test-case-generator\n```\n\nIn your Django project, add the `test_case_generator_command` app to your `INSTALLED_APPS` in settings.py:\n\n```\nINSTALLED_APPS = [\n # Other apps\n 'test_case_generator_command',\n]\n```\n\nNow 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:\n\n```\npython manage.py generate_test_case\n```\nThis will scan for class-based views (CBVs) and generate corresponding test cases for each API method (GET, POST, PUT, DELETE).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Django command to generate test case for rest apis.",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/Ronakjain515/django-rest-test-case-generator/issues",
"Homepage": "https://github.com/Ronakjain515/django-rest-test-case-generator"
},
"split_keywords": [
"django",
" test case generator",
" rest apis",
" testing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7aa9746a3cb5f1beb8f4696548a9a47ba1356735944a7a3aa49ee79278263a4d",
"md5": "3216e208f6f1f250378c1b11efffe654",
"sha256": "2a602441961ca7cf6f652e1c6b3bb2c7ff345f9da03c52682acaf8fa93ee711d"
},
"downloads": -1,
"filename": "django_rest_test_case_generator-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3216e208f6f1f250378c1b11efffe654",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11680,
"upload_time": "2025-02-18T10:59:11",
"upload_time_iso_8601": "2025-02-18T10:59:11.051071Z",
"url": "https://files.pythonhosted.org/packages/7a/a9/746a3cb5f1beb8f4696548a9a47ba1356735944a7a3aa49ee79278263a4d/django_rest_test_case_generator-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7adad1fc963a2edd9d1fb265fb347ddfd976eec9022ea58e395d4826eb934ee1",
"md5": "b2c0f1ac5f5e168b8d59f47dc9a269ea",
"sha256": "501838e9fd6debfcf2640b4ddf21898f12b38dcfd695545e0e030a9c8ad8b658"
},
"downloads": -1,
"filename": "django_rest_test_case_generator-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "b2c0f1ac5f5e168b8d59f47dc9a269ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9849,
"upload_time": "2025-02-18T10:59:15",
"upload_time_iso_8601": "2025-02-18T10:59:15.314436Z",
"url": "https://files.pythonhosted.org/packages/7a/da/d1fc963a2edd9d1fb265fb347ddfd976eec9022ea58e395d4826eb934ee1/django_rest_test_case_generator-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-18 10:59:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Ronakjain515",
"github_project": "django-rest-test-case-generator",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-rest-test-case-generator"
}