Files
mostovik-backend/run_tests.py
Aleksandr Meshchriakov cbfbd8652d feat: Add comprehensive Django user app with tests using model-bakery
- Implemented user authentication with JWT tokens
- Added user and profile models with OneToOne relationship
- Created service layer for business logic separation
- Implemented DRF serializers and views
- Added comprehensive test suite with model-bakery factories
- Fixed ipdb/pdbpp dependency conflicts with custom test runner
- Configured development and production environments
- Added deployment configurations for Apache, systemd, and Docker
2026-01-19 14:12:33 +01:00

30 lines
1.1 KiB
Python
Executable File
Raw 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.
#!/usr/bin/env python
"""Скрипт для запуска тестов с обходом проблемы ipdb"""
import os
import sys
import django
# Монкипатчим ipdb до импорта Django
sys.modules['ipdb'] = type('MockModule', (), {'__getattr__': lambda s, n: None})()
# Настройка Django
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.development')
django.setup()
# Теперь можем безопасно импортировать и запускать тесты
from django.core.management import execute_from_command_line
if __name__ == '__main__':
# Добавляем аргументы командной строки
args = sys.argv[1:] # Убираем имя скрипта
if not args:
# По умолчанию запускаем все тесты user app
args = ['test', 'apps.user']
# Подготовка аргументов для Django
django_args = ['manage.py'] + args
sys.argv = django_args
execute_from_command_line(sys.argv)