init project tests

This commit is contained in:
Maximilian 2025-06-07 19:24:41 +02:00
parent d0ff728224
commit 7c9318c778
44 changed files with 4431 additions and 49 deletions

33
test/run_tests.py Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env python3
"""
Test runner script for Django FBF project.
Runs all tests with proper configuration.
"""
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
if __name__ == "__main__":
# Set up Django environment
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings")
# Add the app directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'app'))
# Setup Django
django.setup()
# Get the Django test runner
TestRunner = get_runner(settings)
test_runner = TestRunner()
# Run tests
failures = test_runner.run_tests(["test"])
if failures:
sys.exit(1)
else:
print("All tests passed!")
sys.exit(0)