2026-01-08 01:00:26 +10:30
|
|
|
"""Testing environment configuration."""
|
|
|
|
|
from config.base import BaseConfig
|
2026-01-08 15:59:53 +10:30
|
|
|
import os
|
2026-01-08 01:00:26 +10:30
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestingConfig(BaseConfig):
|
|
|
|
|
"""Testing configuration."""
|
|
|
|
|
|
|
|
|
|
TESTING = True
|
|
|
|
|
DEBUG = True
|
2026-01-08 15:59:53 +10:30
|
|
|
|
|
|
|
|
# Explicitly set SECRET_KEY for testing
|
|
|
|
|
SECRET_KEY = os.getenv("SECRET_KEY", "test-secret-key-for-testing")
|
2026-01-08 01:00:26 +10:30
|
|
|
|
2026-03-02 23:53:51 +05:45
|
|
|
# CA key encryption — use a fixed test key so tests are deterministic
|
|
|
|
|
CA_ENCRYPTION_KEY = os.getenv("CA_ENCRYPTION_KEY", "test-ca-encryption-key-fixed-for-tests")
|
|
|
|
|
|
2026-01-08 01:00:26 +10:30
|
|
|
# Use in-memory SQLite for testing
|
|
|
|
|
SQLALCHEMY_DATABASE_URI = "sqlite:///:memory:"
|
|
|
|
|
SQLALCHEMY_ECHO = False
|
|
|
|
|
|
|
|
|
|
# Disable CSRF for testing
|
|
|
|
|
WTF_CSRF_ENABLED = False
|
|
|
|
|
|
|
|
|
|
# Fast password hashing for tests
|
|
|
|
|
BCRYPT_LOG_ROUNDS = 4
|
|
|
|
|
|
|
|
|
|
# Disable rate limiting in tests
|
|
|
|
|
RATELIMIT_ENABLED = False
|
|
|
|
|
|
|
|
|
|
# Use different Redis DB for testing
|
|
|
|
|
REDIS_URL = "redis://localhost:6379/15"
|
2026-04-23 15:41:37 +09:30
|
|
|
|
2026-01-08 15:59:53 +10:30
|
|
|
# Use filesystem for sessions in testing
|
|
|
|
|
SESSION_TYPE = "filesystem"
|
|
|
|
|
SESSION_FILE_DIR = "/tmp/flask_session_test"
|
2026-04-23 15:41:37 +09:30
|
|
|
|
|
|
|
|
# Override cookie domain so test_client on localhost can send cookies
|
|
|
|
|
SESSION_COOKIE_DOMAIN = None
|
|
|
|
|
WEBAUTHN_RP_ID = "localhost"
|
|
|
|
|
WEBAUTHN_ORIGIN = "http://localhost:8080"
|
|
|
|
|
FRONTEND_URL = "http://localhost:8080"
|