Files
retoor cae139ead9
DevPlace CI / test (push) Failing after 28m20s
Add personal notes, DeepSearch history, backup offload, and gateway auth throttling
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.
2026-09-12 20:32:31 +02:00

42 lines
1.2 KiB
Python

# retoor <retoor@molodetz.nl>
import json
from devplacepy.seo_meta_text import plain_seo_defaults
from devplacepy.services.jobs import seo_meta_service
def test_generate_requests_the_preamble_bypass(local_db, monkeypatch):
seen = {}
def fake_gateway_complete(
api_key, system, text, timeout, model=None, bypass_preamble=False
):
seen["bypass_preamble"] = bypass_preamble
return (
json.dumps(
{
"seo_title": "A generated title",
"seo_description": "A generated description that is reasonably long.",
"seo_keywords": "one, two, three, four, five",
}
),
None,
)
monkeypatch.setattr(seo_meta_service, "gateway_complete", fake_gateway_complete)
svc = seo_meta_service.SeoMetaService()
defaults = plain_seo_defaults("Title", "Body text")
totals = seo_meta_service.new_usage_totals()
svc._generate(
"post",
"nonexistent-uid",
{"user_uid": ""},
"Title",
"Body text",
defaults,
totals,
"molodetz",
)
assert seen["bypass_preamble"] is True