mirror of
https://github.com/khoaliber/LetterFeed.git
synced 2026-03-02 13:18:27 +00:00
fix: update tests with new base url
This commit is contained in:
@@ -184,15 +184,15 @@ def test_get_newsletter_feed(client: TestClient):
|
|||||||
ns = {"atom": "http://www.w3.org/2005/Atom"}
|
ns = {"atom": "http://www.w3.org/2005/Atom"}
|
||||||
links = root.findall("atom:link", ns)
|
links = root.findall("atom:link", ns)
|
||||||
assert any(
|
assert any(
|
||||||
link.get("rel") == "alternate" and link.get("href") == "http://localhost:8000/"
|
link.get("rel") == "alternate" and link.get("href") == "http://backend:8000/"
|
||||||
for link in links
|
for link in links
|
||||||
)
|
)
|
||||||
logo = root.find("atom:logo", ns)
|
logo = root.find("atom:logo", ns)
|
||||||
assert logo is not None
|
assert logo is not None
|
||||||
assert logo.text == "http://localhost:8000/logo.png"
|
assert logo.text == "http://backend:8000/logo.png"
|
||||||
icon = root.find("atom:icon", ns)
|
icon = root.find("atom:icon", ns)
|
||||||
assert icon is not None
|
assert icon is not None
|
||||||
assert icon.text == "http://localhost:8000/favicon.ico"
|
assert icon.text == "http://backend:8000/favicon.ico"
|
||||||
entry_titles = [
|
entry_titles = [
|
||||||
entry.find("atom:title", ns).text for entry in root.findall("atom:entry", ns)
|
entry.find("atom:title", ns).text for entry in root.findall("atom:entry", ns)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ def test_generate_feed(db_session: Session):
|
|||||||
# In a real scenario, you'd use an XML parser to validate structure and content more thoroughly
|
# In a real scenario, you'd use an XML parser to validate structure and content more thoroughly
|
||||||
assert f"<title>{newsletter.name}</title>" in feed_xml.decode()
|
assert f"<title>{newsletter.name}</title>" in feed_xml.decode()
|
||||||
assert f"<id>urn:letterfeed:newsletter:{newsletter.id}</id>" in feed_xml.decode()
|
assert f"<id>urn:letterfeed:newsletter:{newsletter.id}</id>" in feed_xml.decode()
|
||||||
assert '<link href="http://localhost:8000/" rel="alternate"/>' in feed_xml.decode()
|
assert '<link href="http://backend:8000/" rel="alternate"/>' in feed_xml.decode()
|
||||||
assert "<logo>http://localhost:8000/logo.png</logo>" in feed_xml.decode()
|
assert "<logo>http://backend:8000/logo.png</logo>" in feed_xml.decode()
|
||||||
assert "<icon>http://localhost:8000/favicon.ico</icon>" in feed_xml.decode()
|
assert "<icon>http://backend:8000/favicon.ico</icon>" in feed_xml.decode()
|
||||||
assert "<title>First Entry</title>" in feed_xml.decode()
|
assert "<title>First Entry</title>" in feed_xml.decode()
|
||||||
assert "<title>Second Entry</title>" in feed_xml.decode()
|
assert "<title>Second Entry</title>" in feed_xml.decode()
|
||||||
assert (
|
assert (
|
||||||
|
|||||||
Reference in New Issue
Block a user