pytest-django
pytest-django copied to clipboard
A Django plugin for pytest.
I've implemented `django_db_setup` to do some fancy DB create/destroy logic and have been requesting `django_db_modify_db_settings` to give me a test db name at `settings.DATABASES['default']['TEST']['NAME']. When I upgraded from < 3.6...
I think it would be a good idea to add examples from the testing-chapter of Django's official documentation to the pytest-django documentation: - https://docs.djangoproject.com/en/1.8/intro/tutorial05/ This would enable users interested in...
With `pytest==5.3.3`, fixtures now tear down when they should. This highlighted an issue in the `django_db_blocker` fixture, in that it did not actually trigger the database to be set up....
Ref: https://github.com/pytest-dev/pytest-django/pull/802#discussion_r368134433
In order to access existing database, I put these code into conftest.py according to https://pytest-django.readthedocs.io/en/latest/database.html?highlight=rollback#using-an-existing-external-database-for-tests ``` @pytest.fixture(scope='session') def django_db_setup(): settings.DATABASES['default'] = { 'ENGINE': 'django.db.backends.mysql', 'HOST': 'db.example.com', 'NAME': 'external_db', } ```...
Hey, I have a formset of let's say `Animal` objects `Animal1(age=1, name='test') and Animal2(age=4, name='rex')` which have a unique constrain on `name` field. I want a formset to validate when...
Hello, Since I updated pytest to 4.2, I've got errors inside Django internals for some tests. These tests worked fine with 4.1 and still work fine with Django embedded unittests....
I have been seeing an issue, where it would return False initially, but later True; causing an `AttributeError` with the `mailoutbox` fixture, because `mail.outbox` was not set on the module....
I explain myself, I have a project with a lot of migrations, with 3 important migrations for our case (in that order): 1. a migration that add the field `foo`...