Настройка 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 тестов проекта.
This commit is contained in:
2026-01-06 22:29:01 +03:00
parent 52d5f6fd9f
commit 6692f1bf19
4 changed files with 29 additions and 3 deletions

11
pytest.ini Normal file
View File

@@ -0,0 +1,11 @@
[pytest]
DJANGO_SETTINGS_MODULE = myproject.settings
python_files = tests.py test_*.py *_tests.py
python_classes = Test* *Tests
python_functions = test_*
testpaths = myproject
pythonpath = myproject
addopts = --tb=short --strict-markers --reuse-db
# Django database setup
django_find_project = true