“Django PyTest Wie man Daten lädt” Code-Antworten

Django PyTest Wie man Daten lädt

@pytest.fixture(autouse=True)
def setup(self, db):
    call_command('loaddata', './apps/accounts/fixtures/accounts.json')
    call_command('loaddata', './apps/activation/fixtures/activation.json')
    call_command('loaddata', './apps/questionnaire/fixtures/questionnaire.json')
Outstanding Owl

Django PyTest Wie man Daten lädt

from pytest_django.fixtures import _django_db_fixture_helper

@pytest.fixture(autoscope='module')
def setup_db(request, django_db_setup, django_db_blocker):
    _django_db_fixture_helper(request,·django_db_blocker)
    call_command('loaddata', 'path/to/fixture.json')
Outstanding Owl

Ähnliche Antworten wie “Django PyTest Wie man Daten lädt”

Fragen ähnlich wie “Django PyTest Wie man Daten lädt”

Weitere verwandte Antworten zu “Django PyTest Wie man Daten lädt” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen