Add personal notes, DeepSearch history, backup offload, and gateway auth throttling
DevPlace CI / test (push) Failing after 28m20s
DevPlace CI / test (push) Failing after 28m20s
Also streamline the top navigation: drop the Tools dropdown, make Quizzes and Battles icon-only entries, and remove the Workspace, Containers and Editor entry points from the project detail page.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import re
|
||||
import time
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
import pytest
|
||||
import requests
|
||||
from tests.conftest import BASE_URL
|
||||
@@ -128,3 +130,44 @@ def test_pagination_spans_pages(seeded_db):
|
||||
assert data["pagination"]["total_pages"] >= 2
|
||||
page2 = _audit(admin, event_key="security.authz.denied", page=2)
|
||||
assert len(page2["entries"]) > 0
|
||||
|
||||
|
||||
def _seed_notifications(user_uid, count=30):
|
||||
notifications = get_table("notifications")
|
||||
base = datetime.now(timezone.utc)
|
||||
for i in range(count):
|
||||
notifications.insert(
|
||||
{
|
||||
"uid": generate_uid(),
|
||||
"user_uid": user_uid,
|
||||
"type": "test",
|
||||
"message": f"quota notification {i}",
|
||||
"related_uid": user_uid,
|
||||
"target_url": None,
|
||||
"read": False,
|
||||
"created_at": (base - timedelta(seconds=i)).isoformat(),
|
||||
}
|
||||
)
|
||||
refresh_snapshot()
|
||||
|
||||
|
||||
def test_load_more_link_is_percent_encoded(seeded_db):
|
||||
session, name = _member()
|
||||
user = _db_user(name)
|
||||
_seed_notifications(user["uid"])
|
||||
|
||||
r = session.get(f"{BASE_URL}/notifications")
|
||||
assert r.status_code == 200
|
||||
match = re.search(r'href="(/notifications\?before=[^"]*)"', r.text)
|
||||
assert match, "expected a Load More link on the notifications page"
|
||||
href = match.group(1)
|
||||
|
||||
assert "%2B" in href
|
||||
assert "+" not in href
|
||||
|
||||
cursor = parse_qs(urlparse(href).query)["before"][0]
|
||||
assert "+" in cursor
|
||||
|
||||
r2 = session.get(f"{BASE_URL}{href}")
|
||||
assert r2.status_code == 200
|
||||
assert "quota notification 29" in r2.text
|
||||
|
||||
Reference in New Issue
Block a user