"""A10 — the whole path through the site, as a visitor and a player would walk it: home, sign up, deposit, bet, draw, public result (WEB-05, WEB-06, WEB-10, WEB-12, WEB-13, WEB-22, WEB-26, WEB-27).""" import re from datetime import timedelta from uuid import uuid4 import pytest from django.contrib.auth import get_user_model from django.test import Client from django.utils import timezone from apps.lottery import lifecycle, simulation from apps.lottery.ledger import SimulatedLedger from apps.lottery.models import Round from apps.lottery.simulation import SimulatedChain pytestmark = pytest.mark.django_db PASSWORD = "correct-horse-battery" def form_post(client, url, data, *, page=None): """Read the page first (it carries the CSRF cookie and the idempotency key), then send what a browser would.""" page_html = client.get(page or url).content.decode() token = client.cookies["csrftoken"].value extra = dict(re.findall(r'