from app.main import create_app
from app.core.config import settings


def test_create_app_includes_test_routes_when_enabled(monkeypatch):
    monkeypatch.setattr(settings, "enable_test_routes", True)
    app = create_app()
    paths = set(app.openapi()["paths"])
    assert "/api/v1/test/emails/latest-token" in paths
