# Django DRY Tests
Package with new powerful TestCases and Assets to test django application fast. TDD is supported
You can find **Full Project Documentation** [here][documentation_path]
<hr>
#### Workflows
[![Tests](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/run-tests.yml)
[![Pylint](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/lint.yml)
#### Package
[![Version](https://img.shields.io/pypi/v/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)
[![Development Status](https://img.shields.io/pypi/status/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests)
[![Python version](https://img.shields.io/pypi/pyversions/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)
[![License](https://img.shields.io/pypi/l/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/blob/main/LICENSE)
[![Wheel](https://img.shields.io/pypi/wheel/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)
#### Support
[![Documentation](https://img.shields.io/badge/docs-0094FF.svg)][documentation_path]
[![Discussions](https://img.shields.io/badge/discussions-ff0068.svg)](https://github.com/quillcraftsman/django-dry-tests/discussions/)
[![Issues](https://img.shields.io/badge/issues-11AE13.svg)](https://github.com/quillcraftsman/django-dry-tests/issues/)
#### Downloads
[![Day Downloads](https://img.shields.io/pypi/dd/django-dry-tests)](https://pepy.tech/project/django-dry-tests)
[![Week Downloads](https://img.shields.io/pypi/dw/django-dry-tests)](https://pepy.tech/project/django-dry-tests)
[![Month Downloads](https://img.shields.io/pypi/dm/django-dry-tests)](https://pepy.tech/project/django-dry-tests)
[![All Downloads](https://img.shields.io/pepy/dt/django-dry-tests)](https://pepy.tech/project/django-dry-tests)
#### Languages
[![Languages](https://img.shields.io/github/languages/count/quillcraftsman/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/)
[![Top Language](https://img.shields.io/github/languages/top/quillcraftsman/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/)
#### Development
- [![Release date](https://img.shields.io/github/release-date/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/releases)
[![Last Commit](https://img.shields.io/github/last-commit/quillcraftsman/django-dry-tests/main
)](https://github.com/quillcraftsman/django-dry-tests/)
- [![Issues](https://img.shields.io/github/issues/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/issues/)
[![Closed Issues](https://img.shields.io/github/issues-closed/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/issues/)
- [![Pull Requests](https://img.shields.io/github/issues-pr/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/pulls)
[![Closed Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/pulls)
- [![Discussions](https://img.shields.io/github/discussions/quillcraftsman/django-dry-tests
)](https://github.com/quillcraftsman/django-dry-tests/discussions/)
[//]: # (#### Repository Stats)
[//]: # ([![Stars](https://img.shields.io/github/stars/quillcraftsman/django-dry-tests)
[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/))
[//]: # ([![Contributors](https://img.shields.io/github/contributors/quillcraftsman/django-dry-tests)
[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/graphs/contributors))
[//]: # ([![Forks](https://img.shields.io/github/forks/quillcraftsman/django-dry-tests)
[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/))
<hr>
## Menu
- [Mission](#mission)
- [Open Source Project](#open-source-project)
- [Features](#features)
- [Requirements](#requirements)
- [Development Status](#development-status)
- [Install](#install)
- [Quickstart](#quickstart)
- [Contributing](#contributing)
## Mission
The mission of the **Django DRY Tests** to design and develop open source python package to test **django**
application
- fast
- with minimal code duplication
- with the ability to use **TDD** easily
- simple and comfortable
## Open Source Project
This is the open source project with [MIT license](LICENSE).
Be free to use, fork, clone and contribute.
## Features
- Special **Request**, **Response** and **Form** classes to simple set test data
- Special **SimpleTestCase** and **TestCase** classes with new asserts:
- - The main asserts is **assertTrueResponse** and **assertTrueForm**. You can use this for most cases.
- - Other special asserts (See more in [Full Documentation](https://drytest.craftsman.lol/about.html#features))
## Requirements
- `Django==4` (Lower versions haven't been tested)
- See more in [Full Documentation](https://drytest.craftsman.lol/about.html#requirements)
## Development Status
- Package already available on [PyPi](https://pypi.org/project/django-dry-tests/)
- See more in [Full Documentation](https://drytest.craftsman.lol/about.html#development-status)
## Install
### with pip
```commandline
pip install django-dry-tests
```
See more in [Full Documentation](https://drytest.craftsman.lol/install.html)
## Quickstart
### To test view
```python
class QuickStartViewSimpleTestCase(SimpleTestCase):
"""
SimpleTestCase example
"""
def test_get(self):
"""
Test Example with django-dry-tests
:return:
"""
# Create Request Model
request = Request(
url='/quickstart/'
)
# Create Response Model to check all view.
# You can set only one param without others to check it.
true_response = TrueResponse(
status_code=200,
context=Context(
keys=['quickstart'], # check that quickstart key in context
values=['Quickstart'], # check that "Quickstart" value in context
items={
'quickstart': 'Quickstart'
}, # check both keys and values in context
types={
'quickstart': str
} # check values types without check values
),
content_values = [
'Quickstart',
'<h1>Quickstart title</h1>'
], # check values after template will be rendered
)
# get url response with Django default Test Client
current_response = request.get_response(self.client)
# Use main assert to run all asserts
self.assertTrueResponse(current_response, true_response)
```
### To test Form
```python
class ExampleFromTestCase(SimpleTestCase):
"""
Example Form Test Class
"""
def test_form(self):
"""
Example Test with django-dry-tests
:return:
"""
true_form = TrueForm( # Set Up TrueForm instance
Fields( # TrueForm Fields
count=2, # check fields count
names=[
'number', 'name'
], # check field names
types={
'name': forms.CharField,
'number': forms.IntegerField
} # check fields types
),
)
current_form = ExampleForm() # Get project form
self.assertTrueForm(current_form, true_form) # use this main assert to check all conditions
```
### More examples in [Full Documentation][documentation_path]
## Contributing
You are welcome! To easy start please check:
- [Developer Guidelines](CONTRIBUTING.md)
- [Developer Documentation](https://drytest.craftsman.lol/dev_documentation.html)
- [Code of Conduct](CODE_OF_CONDUCT.md)
- [Security Policy](SECURITY.md)
[documentation_path]: https://drytest.craftsman.lol
Raw data
{
"_id": null,
"home_page": "https://github.com/quillcraftsman/django-dry-tests",
"name": "django-dry-tests",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "",
"keywords": "django,tests,test-driven-development,asserts,testcases",
"author": "quillcraftsman",
"author_email": "quill@craftsman.lol",
"download_url": "https://files.pythonhosted.org/packages/b7/fd/f303479a210a9d5d2dd577b25935ea024daa6e7ef59dc7955549f6c9d458/django-dry-tests-1.0.0.tar.gz",
"platform": null,
"description": "# Django DRY Tests\n\nPackage with new powerful TestCases and Assets to test django application fast. TDD is supported\n\nYou can find **Full Project Documentation** [here][documentation_path]\n\n<hr>\n\n#### Workflows\n[![Tests](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/run-tests.yml)\n[![Pylint](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/quillcraftsman/django-dry-tests/actions/workflows/lint.yml)\n\n#### Package\n[![Version](https://img.shields.io/pypi/v/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)\n[![Development Status](https://img.shields.io/pypi/status/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests)\n[![Python version](https://img.shields.io/pypi/pyversions/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)\n[![License](https://img.shields.io/pypi/l/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/blob/main/LICENSE)\n[![Wheel](https://img.shields.io/pypi/wheel/django-dry-tests.svg)](https://pypi.python.org/pypi/django-dry-tests/)\n\n#### Support\n[![Documentation](https://img.shields.io/badge/docs-0094FF.svg)][documentation_path]\n[![Discussions](https://img.shields.io/badge/discussions-ff0068.svg)](https://github.com/quillcraftsman/django-dry-tests/discussions/)\n[![Issues](https://img.shields.io/badge/issues-11AE13.svg)](https://github.com/quillcraftsman/django-dry-tests/issues/)\n\n#### Downloads\n[![Day Downloads](https://img.shields.io/pypi/dd/django-dry-tests)](https://pepy.tech/project/django-dry-tests)\n[![Week Downloads](https://img.shields.io/pypi/dw/django-dry-tests)](https://pepy.tech/project/django-dry-tests)\n[![Month Downloads](https://img.shields.io/pypi/dm/django-dry-tests)](https://pepy.tech/project/django-dry-tests)\n[![All Downloads](https://img.shields.io/pepy/dt/django-dry-tests)](https://pepy.tech/project/django-dry-tests)\n\n#### Languages\n[![Languages](https://img.shields.io/github/languages/count/quillcraftsman/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/)\n[![Top Language](https://img.shields.io/github/languages/top/quillcraftsman/django-dry-tests)](https://github.com/quillcraftsman/django-dry-tests/)\n\n#### Development\n- [![Release date](https://img.shields.io/github/release-date/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/releases)\n[![Last Commit](https://img.shields.io/github/last-commit/quillcraftsman/django-dry-tests/main\n)](https://github.com/quillcraftsman/django-dry-tests/)\n- [![Issues](https://img.shields.io/github/issues/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/issues/)\n[![Closed Issues](https://img.shields.io/github/issues-closed/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/issues/)\n- [![Pull Requests](https://img.shields.io/github/issues-pr/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/pulls)\n[![Closed Pull Requests](https://img.shields.io/github/issues-pr-closed-raw/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/pulls)\n- [![Discussions](https://img.shields.io/github/discussions/quillcraftsman/django-dry-tests\n)](https://github.com/quillcraftsman/django-dry-tests/discussions/)\n\n[//]: # (#### Repository Stats)\n\n[//]: # ([![Stars](https://img.shields.io/github/stars/quillcraftsman/django-dry-tests)\n\n[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/))\n\n[//]: # ([![Contributors](https://img.shields.io/github/contributors/quillcraftsman/django-dry-tests)\n\n[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/graphs/contributors))\n\n[//]: # ([![Forks](https://img.shields.io/github/forks/quillcraftsman/django-dry-tests)\n\n[//]: # ()](https://github.com/quillcraftsman/django-dry-tests/))\n\n<hr>\n\n## Menu\n\n- [Mission](#mission)\n- [Open Source Project](#open-source-project)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Development Status](#development-status)\n- [Install](#install)\n- [Quickstart](#quickstart)\n- [Contributing](#contributing)\n\n## Mission\n\nThe mission of the **Django DRY Tests** to design and develop open source python package to test **django**\napplication\n- fast\n- with minimal code duplication\n- with the ability to use **TDD** easily \n- simple and comfortable\n\n## Open Source Project\n\nThis is the open source project with [MIT license](LICENSE). \nBe free to use, fork, clone and contribute.\n\n## Features\n\n- Special **Request**, **Response** and **Form** classes to simple set test data\n- Special **SimpleTestCase** and **TestCase** classes with new asserts:\n- - The main asserts is **assertTrueResponse** and **assertTrueForm**. You can use this for most cases.\n- - Other special asserts (See more in [Full Documentation](https://drytest.craftsman.lol/about.html#features))\n\n## Requirements\n\n- `Django==4` (Lower versions haven't been tested)\n- See more in [Full Documentation](https://drytest.craftsman.lol/about.html#requirements)\n\n## Development Status\n\n- Package already available on [PyPi](https://pypi.org/project/django-dry-tests/)\n- See more in [Full Documentation](https://drytest.craftsman.lol/about.html#development-status)\n\n## Install\n\n### with pip\n\n```commandline\npip install django-dry-tests\n```\n\nSee more in [Full Documentation](https://drytest.craftsman.lol/install.html)\n\n## Quickstart\n\n### To test view\n\n```python\nclass QuickStartViewSimpleTestCase(SimpleTestCase):\n \"\"\"\n SimpleTestCase example\n \"\"\"\n\n def test_get(self):\n \"\"\"\n Test Example with django-dry-tests\n :return:\n \"\"\"\n # Create Request Model\n request = Request(\n url='/quickstart/'\n )\n\n # Create Response Model to check all view.\n # You can set only one param without others to check it.\n true_response = TrueResponse(\n status_code=200,\n context=Context(\n keys=['quickstart'], # check that quickstart key in context\n values=['Quickstart'], # check that \"Quickstart\" value in context\n items={\n 'quickstart': 'Quickstart'\n }, # check both keys and values in context\n types={\n 'quickstart': str\n } # check values types without check values\n ),\n content_values = [\n 'Quickstart',\n '<h1>Quickstart title</h1>'\n ], # check values after template will be rendered\n )\n\n # get url response with Django default Test Client\n current_response = request.get_response(self.client)\n # Use main assert to run all asserts\n self.assertTrueResponse(current_response, true_response)\n```\n\n### To test Form\n\n```python\nclass ExampleFromTestCase(SimpleTestCase):\n \"\"\"\n Example Form Test Class\n \"\"\"\n\n def test_form(self):\n \"\"\"\n Example Test with django-dry-tests\n :return:\n \"\"\"\n true_form = TrueForm( # Set Up TrueForm instance\n Fields( # TrueForm Fields\n count=2, # check fields count\n names=[\n 'number', 'name'\n ], # check field names\n types={\n 'name': forms.CharField,\n 'number': forms.IntegerField\n } # check fields types\n ),\n )\n current_form = ExampleForm() # Get project form\n self.assertTrueForm(current_form, true_form) # use this main assert to check all conditions\n```\n\n### More examples in [Full Documentation][documentation_path]\n\n## Contributing\n\nYou are welcome! To easy start please check:\n- [Developer Guidelines](CONTRIBUTING.md)\n- [Developer Documentation](https://drytest.craftsman.lol/dev_documentation.html)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n- [Security Policy](SECURITY.md)\n\n[documentation_path]: https://drytest.craftsman.lol\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Package with new powerful TestCases and Assets to test django application fast. TDD is supported",
"version": "1.0.0",
"project_urls": {
"Changelog": "https://github.com/quillcraftsman/django-dry-tests/releases",
"Documentation": "https://drytest.craftsman.lol",
"Download": "https://pypi.org/project/django-dry-tests/",
"Homepage": "https://github.com/quillcraftsman/django-dry-tests",
"Release notes": "https://github.com/quillcraftsman/django-dry-tests/releases",
"Source": "https://github.com/quillcraftsman/django-dry-tests",
"Tracker": "https://github.com/quillcraftsman/django-dry-tests/issues"
},
"split_keywords": [
"django",
"tests",
"test-driven-development",
"asserts",
"testcases"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a84b15c2c049db844622a94e99fff0eed49e379c65e699d331b0a6bd5a3e4c7d",
"md5": "9546f5a660e5a3301313a4a651259d86",
"sha256": "073f2f110d046eeba951957e66089a770b5ccc15be6ab0e38eaadfa9e543c611"
},
"downloads": -1,
"filename": "django_dry_tests-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9546f5a660e5a3301313a4a651259d86",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 10542,
"upload_time": "2023-10-16T17:24:14",
"upload_time_iso_8601": "2023-10-16T17:24:14.653592Z",
"url": "https://files.pythonhosted.org/packages/a8/4b/15c2c049db844622a94e99fff0eed49e379c65e699d331b0a6bd5a3e4c7d/django_dry_tests-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b7fdf303479a210a9d5d2dd577b25935ea024daa6e7ef59dc7955549f6c9d458",
"md5": "086c7c1545fa5f2bbc93b71b6e162e48",
"sha256": "d36c4f4c00f5b6e94f9c5a744081b24320fbffa524f28338dd27cd1935fb5200"
},
"downloads": -1,
"filename": "django-dry-tests-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "086c7c1545fa5f2bbc93b71b6e162e48",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 8657,
"upload_time": "2023-10-16T17:24:15",
"upload_time_iso_8601": "2023-10-16T17:24:15.881196Z",
"url": "https://files.pythonhosted.org/packages/b7/fd/f303479a210a9d5d2dd577b25935ea024daa6e7ef59dc7955549f6c9d458/django-dry-tests-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-16 17:24:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "quillcraftsman",
"github_project": "django-dry-tests",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "django-dry-tests"
}