Skip to content

"Database access not allowed" in Doctests (Django) #1180

Closed
@acjackson

Description

@acjackson

I'm trying to get database access (django) in a few of my doctests with

pytestmark = pytest.mark.django_db

or

@pytest.mark.django_db

But I keep getting the following error:

Failed: Database access not allowed, use the "django_db" mark to enable it.

Is Django database access supported in doctests?
My other unittests using the Django database work fine.

I use
pytest 1.8.2.dev1 (#1057)
pytest-django==2.9.1
Django==1.8

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