Skip to content

Commit dc2c3a5

Browse files
committed
Use assertCountEqual to test social links list directly
1 parent ea8d3cc commit dc2c3a5

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

tbx/core/tests/test_jsonld.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,14 @@ def test_organization_jsonld_structure(self):
6464

6565
# Test social media links
6666
self.assertIn("sameAs", org_data)
67-
same_as = org_data["sameAs"]
68-
self.assertIsInstance(same_as, list)
69-
self.assertGreater(len(same_as), 0)
70-
71-
# Check for expected social media links
72-
expected_links = [
73-
"https://bsky.app/profile/torchbox.com",
74-
"https://www.linkedin.com/company/torchbox",
75-
"https://www.instagram.com/torchboxltd/",
76-
]
77-
for link in expected_links:
78-
self.assertIn(link, same_as)
67+
self.assertCountEqual(
68+
org_data["sameAs"],
69+
[
70+
"https://bsky.app/profile/torchbox.com",
71+
"https://www.linkedin.com/company/torchbox",
72+
"https://www.instagram.com/torchboxltd/",
73+
],
74+
)
7975

8076
def test_organization_jsonld_social_links(self):
8177
"""Test that Organization JSON-LD includes correct social media links."""

0 commit comments

Comments
 (0)