feat: add durable WorldQuant backtests with UI and AI confirmation
This commit is contained in:
@@ -12,6 +12,7 @@ from app.main import create_app
|
||||
from app.models import Base
|
||||
from app.worldquant import WqClient
|
||||
from tests.ai_fake import fake_model
|
||||
from tests.backtest_fake import Platform
|
||||
|
||||
TEST_PASSWORD = "browser-test-password"
|
||||
|
||||
@@ -78,6 +79,8 @@ def create_test_app():
|
||||
public_origin="http://127.0.0.1:5179",
|
||||
)
|
||||
records = [sample(i) for i in range(620)]
|
||||
simulations = Platform()
|
||||
simulations.existing_alpha_ids = [f"TEST{i:04}" for i in range(1, 100)]
|
||||
|
||||
def upstream(request):
|
||||
path = request.url.path
|
||||
@@ -102,6 +105,10 @@ def create_test_app():
|
||||
},
|
||||
headers={"Set-Cookie": "mock=only; Path=/"},
|
||||
)
|
||||
if path.startswith("/simulations") or (
|
||||
path.startswith("/alphas/") and path.rsplit("/", 1)[-1] in simulations.alphas
|
||||
):
|
||||
return simulations(request)
|
||||
if request.method != "GET":
|
||||
raise AssertionError("Browser acceptance attempted an upstream mutation")
|
||||
if path == "/users/self":
|
||||
|
||||
Reference in New Issue
Block a user