pytest-django
pytest-django copied to clipboard
A Django plugin for pytest.
When using --reuse-db it would be nice if pytest-django could detect that the database it's reusing has applied migrations that don't exist (due to changing branch or code edits) and...
Is there an implementation for this in pytest-django? Thanks a lot!
Hey all, I ran into an issue trying to customize [`django_db_modify_db_settings`](https://pytest-django.readthedocs.io/en/latest/database.html#django-db-modify-db-settings). In my root level `conftest.py` I tried to make the tests run a sqlite in-memory database using (instead of...
Once updating to Pytest 7 from 6.2.5, tests that work in pytest < 7 fail with: ``` RuntimeError: Database access not allowed, use the "django_db" mark, or the "db" or...
I just upgraded to pytest-django 4.1.0 from 3.10.0 and a lot of my tests broke which rely on admin_client / admin_user. It turns out that the code in https://github.com/pytest-dev/pytest-django/commit/79b7754669660543b593bdad471e73a9dabc04ed uses...
Short example: ```python from django.test.client import Client from pytest_django import asserts def test_main_index_page(client: Client) -> None: response = client.get("/") asserts.assertTemplateUsed(response, "main/index.html") ``` Gives the following error in mypy ``` main\tests.py:7:...
# pytest-pythonpath is no longer compatible with pytest 7 It should be removed or mentioned from/in docs [here]. [This] should be used instead. [here]: [This]:
When pytest is run, it displays all the versions of the platform and plugins in the report header. Currently the `pytest-django` report header only adds the Django settings and (if...
I have a project that works with 3rd party database, all the models for that database have managed = False in Meta because I don't want them to be created...
Hello! I got the following, when I run `pytest`: ``` pytest==6.2.5 pytest-cov==3.0.0 pytest-django==4.5.2 pytest-forked==1.4.0 pytest-xdist==2.5.0 ``` ``` /usr/local/lib/python3.10/site-packages/django/db/backends/utils.py:85: in _execute return self.cursor.execute(sql, params) E psycopg2.errors.UndefinedTable: relation "applable_modelname" does not exist...