chore: prepare release v0.4.0
This commit is contained in:
+27
-2
@@ -190,9 +190,34 @@ class TestJSONFeed:
|
||||
assert item["authors"] == [{"name": "@jf@example.io"}]
|
||||
|
||||
def test_json_feed_falls_back_to_site_default_fediverse_creator(
|
||||
self, client: TestClient, tmp_content_dir: Path
|
||||
self, tmp_path: Path, tmp_content_dir: Path
|
||||
) -> None:
|
||||
pass # Requires a custom config with site.fediverse_creator set
|
||||
"""When a post has no fediverse_creator, fall back to site.fediverse_creator."""
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from volumen.app import create_app
|
||||
from volumen.config import Config
|
||||
from volumen.store import Store
|
||||
|
||||
config_path = tmp_path / "custom.toml"
|
||||
users_path = tmp_path / "users.toml"
|
||||
users_path.write_text("")
|
||||
config_path.write_text(
|
||||
f'content_dir = "{tmp_content_dir}"\n'
|
||||
f'users_file = "{users_path}"\n'
|
||||
"\n[site]\n"
|
||||
'fediverse_creator = "@siteowner@example.social"\n'
|
||||
)
|
||||
custom_config = Config.load(path=str(config_path))
|
||||
custom_store = Store(str(tmp_content_dir), default_lang="en")
|
||||
custom_app = create_app(custom_config, custom_store)
|
||||
custom_client = TestClient(custom_app)
|
||||
|
||||
response = custom_client.get("/api/volumen/feed.json")
|
||||
assert response.status_code == 200
|
||||
item = response.json()["items"][0]
|
||||
assert "authors" in item
|
||||
assert item["authors"] == [{"name": "@siteowner@example.social"}]
|
||||
|
||||
|
||||
class TestSitemap:
|
||||
|
||||
Reference in New Issue
Block a user