21 lines
475 B
Python
21 lines
475 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import os
|
||
|
|
|
||
|
|
import django
|
||
|
|
import pytest
|
||
|
|
from django.core.management import call_command
|
||
|
|
|
||
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "artifex.test_settings")
|
||
|
|
django.setup()
|
||
|
|
|
||
|
|
|
||
|
|
@pytest.fixture(scope="session", autouse=True)
|
||
|
|
def migrated_database():
|
||
|
|
call_command("migrate", verbosity=0, interactive=False)
|
||
|
|
|
||
|
|
|
||
|
|
@pytest.fixture(autouse=True)
|
||
|
|
def clean_database(migrated_database):
|
||
|
|
call_command("flush", verbosity=0, interactive=False)
|