feat: add test suites for backup schedules, service config, auth token, bookmarks, content permissions, devii adopt, and devrant auth

Add comprehensive test coverage for seven new API areas:
- Backup schedules CRUD operations in admin panel
- Service configuration saving and retrieval for news AI model
- Token authentication with email/username and JSON body support
- Bookmarking for project and news targets with invalid type validation
- Content permissions testing with member and admin session fixtures
- Devii adopt endpoint redirect behavior and session cookie handling
- Devrant authentication flow with user registration and token retrieval
This commit is contained in:
2026-06-23 00:47:40 +00:00
parent 34e33995c4
commit e773067106
28 changed files with 2737 additions and 0 deletions
+26
View File
@@ -301,3 +301,29 @@ def test_react_on_comment_target(app_server):
assert (
get_table("reactions").count(target_type="comment", target_uid=comment_uid) == 1
)
def test_react_on_gist_target(app_server):
s, name = _session_reactions()
gist_uid = generate_uid()
r = s.post(
f"{BASE_URL}/reactions/gist/{gist_uid}",
data={"emoji": HEART},
headers=AJAX_reactions,
)
assert r.json()["counts"][HEART] == 1
assert get_table("reactions").count(target_type="gist", target_uid=gist_uid) == 1
def test_react_on_project_target(app_server):
s, name = _session_reactions()
project_uid = generate_uid()
r = s.post(
f"{BASE_URL}/reactions/project/{project_uid}",
data={"emoji": ROCKET},
headers=AJAX_reactions,
)
assert r.json()["counts"][ROCKET] == 1
assert (
get_table("reactions").count(target_type="project", target_uid=project_uid) == 1
)