{"id":15297412,"url":"https://github.com/idlesign/pytest-djangoapp","last_synced_at":"2025-04-05T06:07:21.605Z","repository":{"id":32583175,"uuid":"137551687","full_name":"idlesign/pytest-djangoapp","owner":"idlesign","description":"Nice pytest plugin to help you with Django pluggable application testing.","archived":false,"fork":false,"pushed_at":"2024-10-09T01:50:05.000Z","size":185,"stargazers_count":41,"open_issues_count":10,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T05:07:42.194Z","etag":null,"topics":["django","pytest","pytest-plugin","python","python2","python3","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://github.com/idlesign/pytest-djangoapp","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-16T04:05:31.000Z","updated_at":"2024-12-08T08:05:08.000Z","dependencies_parsed_at":"2023-01-14T21:39:24.401Z","dependency_job_id":"162438a9-c636-4f5c-af53-bd33f058549e","html_url":"https://github.com/idlesign/pytest-djangoapp","commit_stats":{"total_commits":164,"total_committers":5,"mean_commits":32.8,"dds":0.07317073170731703,"last_synced_commit":"09638411a0553cd2717f9edff50549f4131c4cb1"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpytest-djangoapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpytest-djangoapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpytest-djangoapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fpytest-djangoapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/pytest-djangoapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294537,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","pytest","pytest-plugin","python","python2","python3","testing","testing-tools"],"created_at":"2024-09-30T19:17:19.518Z","updated_at":"2025-04-05T06:07:21.567Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytest-djangoapp\n================\nhttps://github.com/idlesign/pytest-djangoapp\n\n|release| |lic| |coverage|\n\n.. |release| image:: https://img.shields.io/pypi/v/pytest-djangoapp.svg\n    :target: https://pypi.python.org/pypi/pytest-djangoapp\n\n.. |lic| image:: https://img.shields.io/pypi/l/pytest-djangoapp.svg\n    :target: https://pypi.python.org/pypi/pytest-djangoapp\n\n.. |coverage| image:: https://img.shields.io/coveralls/idlesign/pytest-djangoapp/master.svg\n    :target: https://coveralls.io/r/idlesign/pytest-djangoapp\n\n\nDescription\n-----------\n\n*Nice pytest plugin to help you with Django pluggable application testing.*\n\nThis exposes some useful tools for Django applications developers to facilitate tests authoring, including:\n\n* Settings overriding\n* Template tags testing\n* User creation\n* Request object creation\n* Management command calls\n* Mailing\n* Migrations\n* Messages\n* DB queries audit\n* Live server \u0026 client UI testing\n* etc.\n\nSuitable for testing apps for Django 1.8+.\n\n\nHow to use\n----------\n\nLet's say you have classical tests placing (inside application directory):\n\n.. code-block::\n\n    package_dir\n    |__ myapp\n    |  |__ __init__.py\n    |  |__ tests\n    |  |  |__ __init__.py\n    |  |  |__ conftest.py  \u003c- Configure djangoapp here.\n    |\n    |__ setup.py\n\n\nAdd the following lines into `conftest.py` to configure `djangoapp` and start using it:\n\n.. code-block:: python\n\n    # conftest.py\n    from pytest_djangoapp import configure_djangoapp_plugin\n\n    pytest_plugins = configure_djangoapp_plugin()\n\n\nFixtures usage examples can be found in the documentation and the source code.\n\n\nTesting an entire project\n-------------------------\n\nDespite the fact that `djangoapp` is primarily aimed to reusable\nDjango applications testing one can use it also to test a project (a set of apps).\nFor that, pass a dotted settings module path into `settings` argument:\n\n\n.. code-block:: python\n\n    pytest_plugins = configure_djangoapp_plugin(\n        settings='myproject.settings.settings_testing',\n        migrate=False,  # If you do not want to apply migrations.\n    )\n\n\n\nWhat about pytest-django\n------------------------\n\n`pytest-djangoapp` does not depend on `pytest-django`.\n\nThere are design decisions in `pytest-django` that might make it uncomfortable to work with.\n\n1. It uses `setuptools` entrypoints feature for `pytest` plugin discovery. It's not a problem by itself,\n   but all kinds of bootstrapping with side effects made by `pytest-django` just on startup,\n   make the plugin a poor choice for cases of system-wide (i.e. not venv) installations.\n\n2. Philosophy that next to no unit test should require DB access may be quite annoying.\n\n3. Some fixtures (e.g. `django_assert_num_queries`) usability arouse questions.\n\nDespite that `pytest-django` is nice, of course.\n\n\n`pytest-djangoapp` fixtures allow the use of Django without marking all relevant tests as needing\na database, as is required by pytest-django which provides the ``django_db`` mark and db fixtures.\n\nIf you have `pytest-django` already installed, it can be disabled for projects\nusing `pytest-djangoapp` by adding the following lines into ``pytest.ini``:\n\n.. code-block:: ini\n\n    # pytest.ini\n    [pytest]\n    addopts = -p no:django\n\n\nDocumentation\n-------------\n\nhttp://pytest-djangoapp.readthedocs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fpytest-djangoapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fpytest-djangoapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fpytest-djangoapp/lists"}