def pytest_configure():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pytests.django_settings')
import django
django.setup()
from django.core.management import execute_from_command_line
execute_from_command_line(['manage.py', 'makemigrations', 'test_app'])
execute_from_command_line(['manage.py', 'migrate'])
评论列表
文章目录