# retoor <retoor@molodetz.nl>

from tests.conftest import BASE_URL


def test_devii_usage_as_guest(page, app_server):
    resp = page.request.get(f"{BASE_URL}/devii/usage")
    data = resp.json()
    assert "used_pct" in data
    assert "turns_today" in data
    assert data["turns_today"] == 0


def test_devii_usage_as_logged_in(alice):
    page, _ = alice
    resp = page.request.get(f"{BASE_URL}/devii/usage")
    data = resp.json()
    assert "used_pct" in data
    assert "turns_today" in data
