Skip to content

Populating the database with data - are the docs wrong or my setup?  #490

Open
@mpasternak

Description

@mpasternak

Hello,

the docs suggest an approach to populate the database with the initial data this way: http://pytest-django.readthedocs.io/en/latest/database.html#populate-the-database-with-initial-test-data

I created a small demonstrational app that uses exactly that approach. Unfortunately, I am not able to see the test data anywhere else except the first test case ran. In the first test case everything is okay. In the subsequent test cases, the data are gone from the database.

Am I doing something wrong? Here is the conftest: https://github.com/mpasternak/pytest-django-pytest-splinter-test/blob/master/demo1/demo1_app/conftest.py and here are my tests: https://github.com/mpasternak/pytest-django-pytest-splinter-test/blob/master/demo1/demo1_app/tests.py#L21

When I change the scope of the django_db_setup fixture to function, everything comes back to normal.

So, is this a bug or should I create a PR to update the documentation? Is it somehow related to this issue: #329 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions