Files
mostovik-backend/check_tests.py
Aleksandr Meshchriakov 06b30fca02 feat: implement CI/CD pipeline with Gitea Actions
- Add Gitea Actions workflow with 4 stages: lint, test, build, push
- Configure ruff linting and formatting checks
- Set up Django tests with PostgreSQL and Redis services
- Implement Docker image building for web and celery services
- Add requirements.txt and requirements-dev.txt generation
- Fix ipdb compatibility issues in test runner
- Update ruff configuration for Django compatibility
- Add comprehensive CI/CD documentation
2026-01-19 14:24:48 +01:00

61 lines
1.8 KiB
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.
#!/usr/bin/env python
"""Проверка тестовой среды"""
import os
import sys
import django
# Настройка Django
sys.path.append(os.path.join(os.getcwd(), "src"))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.development")
django.setup()
print("✅ Django настроен успешно!")
# Проверка импортов
try:
from apps.user.tests.test_views import *
print("✅ test_views импортирован успешно!")
except Exception as e:
print(f"❌ Ошибка импорта test_views: {e}")
try:
from apps.user.tests.test_models import *
print("✅ test_models импортирован успешно!")
except Exception as e:
print(f"❌ Ошибка импорта test_models: {e}")
try:
from apps.user.tests.test_serializers import *
print("✅ test_serializers импортирован успешно!")
except Exception as e:
print(f"❌ Ошибка импорта test_serializers: {e}")
try:
from apps.user.tests.test_services import *
print("✅ test_services импортирован успешно!")
except Exception as e:
print(f"❌ Ошибка импорта test_services: {e}")
try:
from apps.user.tests.factories import ProfileFactory, UserFactory
print("✅ factories импортированы успешно!")
# Тест создания объектов
user = UserFactory.create_user()
print(f"✅ Создан пользователь: {user.username}")
profile = ProfileFactory.create_profile()
print(f"✅ Создан профиль: {profile.full_name}")
except Exception as e:
print(f"❌ Ошибка работы с фабриками: {e}")
print("\n🏁 Проверка завершена!")