Skip to content

django_db_setup data only available before first tearDown #788

Open
@frruit

Description

@frruit

Hi,
Inside the conftest.py I have following configuration

@pytest.fixture(scope='session')
def django_db_setup(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock():
        call_command('loaddata', 'tests/test_data/test_data1.json', database='default')
        call_command('loaddata', 'tests/test_data/test_data2.json', database='ipr')

As you can see i use two different DB's

However, test first test case has access to the populated data and is successful but all test cases after that have no data. After debugging I have figured out that the tearDown methods flushs the db and no loaddata occures anymore.

HELP, I need somebody :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions