Files
octopus/myproject/conftest.py
Andrey Smakotin 6692f1bf19 Настройка pytest для корректной работы с django-tenants
Добавлена конфигурация pytest.ini с правильным pythonpath для поддержки Django проекта в подкаталоге myproject. Создан conftest.py для инициализации Django при запуске тестов.

Изменения:
- Добавлен pytest.ini с настройками DJANGO_SETTINGS_MODULE и pythonpath
- Создан myproject/conftest.py для автоматической настройки Django
- Удален устаревший orders/tests.py
- Обновлен requirements.txt

Теперь VS Code корректно обнаруживает все 119 тестов проекта.
2026-01-06 22:29:01 +03:00

17 lines
525 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""
Конфигурация pytest для Django проекта с django-tenants
"""
import os
import django
from django.conf import settings
# Устанавливаем переменную окружения для settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
# Инициализируем Django
def pytest_configure(config):
"""Настройка Django перед запуском тестов"""
if not settings.configured:
django.setup()