{ "info": { "author": "Jo\u00e3o Sampaio", "author_email": "jpmelos@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only" ], "description": "===============\ndjango-testcase\n===============\n\n.. image:: https://travis-ci.org/jpmelos/django-testcase.svg?branch=master\n :target: https://travis-ci.org/jpmelos/django-testcase\n\n django-testcase provides a TestCase mixin to provide new useful functions for Django tests.\n\nSupports Django 1.10 and later, only with Python 3.4 and later.\n\n------------\nInstallation\n------------\n\n::\n\n $ pip install django-testcase\n\n-----------\nBasic usage\n-----------\n\nSimply subclass it in a ``TestCase``::\n\n from django.test import TestCase\n from django_testcase import TestCaseMixin\n\n class LoginViewTestCase(TestCaseMixin, TestCase):\n def test_login(self):\n pass\n\n-----------------\nAvailable methods\n-----------------\n\n``.create_user(username='test', email='test@test.com', password='test', is_superuser=False, *args, **kwargs)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreate a user with the given attributes. Any extra arguments passed will be passed to the creation call as is.\n\n``.capture_output()``\n^^^^^^^^^^^^^^^^^^^^\n\nAllows testing Django's TestCase output system calls. Usage::\n\n with capture_output() as sys:\n self.statement()\n\nIn this situation, ``sys`` is a mocked object and can be tested with ``unittest.mock`` methods.\n\n``.login(username='test', password='test', create_superuser=False)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nLogs the user in. If the user does not exist, it will be created, taking ``is_superuser`` into consideration.\n\n``.logout()``\n^^^^^^^^^^^^\n\nLogs the user out.\n\n``.assertIsAuthenticated(user)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAsserts the given user is authenticated.\n\n``.assertIsAnonymous()``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAssets there is no user authenticated.\n\n``.assertRedirectsToLogin(response, next_url=None)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAsserts a given response redirects to the login page specified by ``settings.LOGIN_URL``, with a ``?next=`` URL if the parameter is given.\n\n``.assertIssuedMessage(response, level, message)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nChecks if the message ``message`` with level ``level`` has been issued. Only an exact match is accepted.\n\n``.jpost(url, data)``\n^^^^^^^^^^^^^^^^^^^^^\n\nSends ``data`` as a POST payload to ``url``.\n\n``.create(klass, *args, **kwargs)``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreates an object of class ``klass`` with the passed arguments. Calls ``.full_clean()`` before saving.\n\n-----------------\nDevelopment tasks\n-----------------\n\nInstall for development and with dependencies::\n\n $ python install -e .[dev]\n\nAsserting code quality\n^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ python dev.py quality\n\nPackaging for PyPI distribution\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n $ python dev.py package\n\nThe build will happen if the repository passes the quality tests and is clean: no untracked files are found. If not, you can see what's wrong with ``git clean -dfx --dry-run`` and remove or track and commit those files.\n\nBuilds will be available at ``dist``, in wheel and source.\n\n----------\nContribute\n----------\n\nPull requests are welcome.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jpmelos/django-testcase", "keywords": "tests,django", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-testcase", "package_url": "https://pypi.org/project/django-testcase/", "platform": "", "project_url": "https://pypi.org/project/django-testcase/", "project_urls": { "Homepage": "http://github.com/jpmelos/django-testcase" }, "release_url": "https://pypi.org/project/django-testcase/0.1.1/", "requires_dist": [ "certifi (==2017.7.27.1); extra == 'dev'", "chardet (==3.0.4); extra == 'dev'", "coverage (==4.4.1); extra == 'dev'", "idna (==2.5); extra == 'dev'", "isort (==4.2.15); extra == 'dev'", "pep8 (==1.7.0); extra == 'dev'", "pkginfo (==1.4.1); extra == 'dev'", "pluggy (==0.4.0); extra == 'dev'", "py (==1.4.34); extra == 'dev'", "pyflakes (==1.6.0); extra == 'dev'", "requests (==2.18.3); extra == 'dev'", "requests-toolbelt (==0.8.0); extra == 'dev'", "subcomm (==0.3.1); extra == 'dev'", "tox (==2.7.0); extra == 'dev'", "tqdm (==4.15.0); extra == 'dev'", "twine (==1.9.1); extra == 'dev'", "urllib3 (==1.22); extra == 'dev'", "virtualenv (==15.1.0); extra == 'dev'" ], "requires_python": ">=3.4, <3.7", "summary": "A TestCaseMixin utility.", "version": "0.1.1" }, "last_serial": 3889837, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e503f3cbfd989bf065f02c9ca4401913", "sha256": "28c042e5a250004da2db044bcd5423349229982528236815a4865d4e1265c13f" }, "downloads": -1, "filename": "django_testcase-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e503f3cbfd989bf065f02c9ca4401913", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4644, "upload_time": "2017-08-11T15:26:13", "url": "https://files.pythonhosted.org/packages/56/b8/03d85dc601b62eba7fa7f39f2a6143fff43ef5b572caab30b77c9d391629/django_testcase-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9fb692ddaf032ee5e857c31d675d0f13", "sha256": "877cfa54df4df9e334254e5204670fa74b55f09dedb01a352d33b1fc35a754a1" }, "downloads": -1, "filename": "django-testcase-0.1.tar.gz", "has_sig": false, "md5_digest": "9fb692ddaf032ee5e857c31d675d0f13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3836, "upload_time": "2017-08-11T15:26:14", "url": "https://files.pythonhosted.org/packages/6c/98/3047bf5a631116c7f0360f829e97c458bcf78d5815eb222ff0bec9529f23/django-testcase-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7734c52f81608da0b4ace8fbf61b14a8", "sha256": "245229922d8946b68bdfaab2921daf153ecb52a6f73c249c1ad3f39efce57cfc" }, "downloads": -1, "filename": "django_testcase-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7734c52f81608da0b4ace8fbf61b14a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <3.7", "size": 4087, "upload_time": "2018-05-23T02:09:03", "url": "https://files.pythonhosted.org/packages/7d/4b/0a9e46559028453ee6b93afae7b5837d472e1e6cf50b93bfa02fed803d92/django_testcase-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "def16afbab42505a983740aa0e23a344", "sha256": "ce8326c197dac03d7b90acd96b1c316035ceae33d4a6000bfc0c2a2e98d94d3d" }, "downloads": -1, "filename": "django-testcase-0.1.1.tar.gz", "has_sig": false, "md5_digest": "def16afbab42505a983740aa0e23a344", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <3.7", "size": 4859, "upload_time": "2018-05-23T02:09:05", "url": "https://files.pythonhosted.org/packages/6b/3e/870acfc3e8a945ce729c05fa63661aace5cdc1c81f64726dc51e78da719b/django-testcase-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7734c52f81608da0b4ace8fbf61b14a8", "sha256": "245229922d8946b68bdfaab2921daf153ecb52a6f73c249c1ad3f39efce57cfc" }, "downloads": -1, "filename": "django_testcase-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7734c52f81608da0b4ace8fbf61b14a8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4, <3.7", "size": 4087, "upload_time": "2018-05-23T02:09:03", "url": "https://files.pythonhosted.org/packages/7d/4b/0a9e46559028453ee6b93afae7b5837d472e1e6cf50b93bfa02fed803d92/django_testcase-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "def16afbab42505a983740aa0e23a344", "sha256": "ce8326c197dac03d7b90acd96b1c316035ceae33d4a6000bfc0c2a2e98d94d3d" }, "downloads": -1, "filename": "django-testcase-0.1.1.tar.gz", "has_sig": false, "md5_digest": "def16afbab42505a983740aa0e23a344", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4, <3.7", "size": 4859, "upload_time": "2018-05-23T02:09:05", "url": "https://files.pythonhosted.org/packages/6b/3e/870acfc3e8a945ce729c05fa63661aace5cdc1c81f64726dc51e78da719b/django-testcase-0.1.1.tar.gz" } ] }