summaryrefslogtreecommitdiff
path: root/tests/syndication_tests
diff options
context:
space:
mode:
authorMarcelo Galigniana <marcelogaligniana@gmail.com>2022-05-25 19:45:46 -0300
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-05-26 09:08:34 +0200
commit7e4656e4b2189390a433a149091442d53a777e2b (patch)
tree62e39edd990ccfc58fcf627fd1a8d8731a1354c6 /tests/syndication_tests
parentb949e40e8c32a393f480399e2d70b653108098b6 (diff)
Refs #22078 -- Added syndication test for feeds with static methods.
Diffstat (limited to 'tests/syndication_tests')
-rw-r--r--tests/syndication_tests/feeds.py6
-rw-r--r--tests/syndication_tests/tests.py6
-rw-r--r--tests/syndication_tests/urls.py1
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/syndication_tests/feeds.py b/tests/syndication_tests/feeds.py
index f8c0a27832..223a0b0bb1 100644
--- a/tests/syndication_tests/feeds.py
+++ b/tests/syndication_tests/feeds.py
@@ -47,6 +47,12 @@ class TestRss2FeedWithCallableObject(TestRss2Feed):
ttl = TimeToLive()
+class TestRss2FeedWithStaticMethod(TestRss2Feed):
+ @staticmethod
+ def categories():
+ return ("javascript", "vue")
+
+
class TestRss2FeedWithGuidIsPermaLinkTrue(TestRss2Feed):
def item_guid_is_permalink(self, item):
return True
diff --git a/tests/syndication_tests/tests.py b/tests/syndication_tests/tests.py
index 207ffb7bc8..6aaf80c1a9 100644
--- a/tests/syndication_tests/tests.py
+++ b/tests/syndication_tests/tests.py
@@ -202,6 +202,12 @@ class SyndicationFeedTest(FeedTestCase):
chan = doc.getElementsByTagName("rss")[0].getElementsByTagName("channel")[0]
self.assertChildNodeContent(chan, {"ttl": "700"})
+ def test_rss2_feed_with_static_methods(self):
+ response = self.client.get("/syndication/rss2/with-static-methods/")
+ doc = minidom.parseString(response.content)
+ chan = doc.getElementsByTagName("rss")[0].getElementsByTagName("channel")[0]
+ self.assertCategories(chan, ["javascript", "vue"])
+
def test_rss2_feed_guid_permalink_false(self):
"""
Test if the 'isPermaLink' attribute of <guid> element of an item
diff --git a/tests/syndication_tests/urls.py b/tests/syndication_tests/urls.py
index 7ebcbf0e5b..5d2b23bf0a 100644
--- a/tests/syndication_tests/urls.py
+++ b/tests/syndication_tests/urls.py
@@ -7,6 +7,7 @@ urlpatterns = [
path(
"syndication/rss2/with-callable-object/", feeds.TestRss2FeedWithCallableObject()
),
+ path("syndication/rss2/with-static-methods/", feeds.TestRss2FeedWithStaticMethod()),
path("syndication/rss2/articles/<int:entry_id>/", feeds.TestGetObjectFeed()),
path(
"syndication/rss2/guid_ispermalink_true/",