Skip to content

Commit f772e23

Browse files
committed
Test against actual blog page
1 parent 7d69cf4 commit f772e23

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tbx/core/tests/test_jsonld.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,11 @@ def test_breadcrumb_template_included(self):
125125

126126
def test_blog_posting_template_included(self):
127127
"""Test that blog posting JSON-LD template is included for blog pages."""
128-
# This test would need to be run on an actual blog page
129-
# For now, we'll just verify the template exists
130-
try:
131-
template = get_template("patterns/pages/blog/blog-posting-jsonld.html")
132-
self.assertIsNotNone(template)
133-
except Exception as e:
134-
self.fail(f"Blog posting JSON-LD template not found: {e}")
128+
response = self.client.get(self.blog_post.url)
129+
schema = self._extract_jsonld_by_type(response.content, "BlogPosting")
130+
131+
self.assertGreater(len(schema), 0, "BlogPosting JSON-LD not found")
132+
self.assertEqual(schema[0]["headline"], "Test Blog Post")
135133

136134
def test_breadcrumb_template_exists(self):
137135
"""Test that breadcrumb JSON-LD template exists."""

0 commit comments

Comments
 (0)