Skip to content

_django_db_setup fails with data migrations #341

@kuboschek

Description

@kuboschek

Situation

In my project, I have a data migration that transfers one value of a certain model to another property of the same model. During test setup, all migrations are run as per default fixture of pytest.

Expected behavior

pytest-django runs all migrations, including data migrations

Actual behavior

All tests end with errors, due to DB use being disallowed during test setup

Versions

platform linux2 -- Python 2.7.6, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
django settings: project.mysite.settings.local (from ini file)
rootdir: /vagrant, inifile: pytest.ini
plugins: django-2.9.1, pythonpath-0.7

Possible resolution

Is there a way of still using that default fixture, but allowing DB access, or not running this specific migration?

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