Skip to content

Commit

Permalink
Add (failing) test for syndication support.
Browse files Browse the repository at this point in the history
  • Loading branch information
esteele committed Apr 11, 2012
1 parent 7530be7 commit b8e0ec6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion plone/app/collection/tests/test_collection.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from plone.testing.z2 import Browser from plone.testing.z2 import Browser
from transaction import commit from transaction import commit
from zope.component import getUtility, getMultiAdapter from zope.component import getUtility, getMultiAdapter
from Products.CMFCore.utils import getToolByName


from plone.app.collection.portlets import collectionportlet from plone.app.collection.portlets import collectionportlet
from .base import CollectionTestCase, CollectionPortletTestCase from .base import CollectionTestCase, CollectionPortletTestCase
Expand Down Expand Up @@ -143,6 +144,18 @@ def test_selectedViewFields(self):
# check if there are selectedViewFields # check if there are selectedViewFields
self.assertTrue(len(collection.selectedViewFields()) > 0) self.assertTrue(len(collection.selectedViewFields()) > 0)


def test_syndication_enabled_by_default(self):
portal = self.layer['portal']
login(portal, 'admin')
# add a collection, so we can add a query to it
portal.invokeFactory("Collection",
"collection",
title="New Collection")
collection = portal['collection']
syn = getToolByName(portal, 'portal_syndication')
self.assertTrue(syn.isSyndicationAllowed(collection))




class TestCollectionPortlet(CollectionPortletTestCase): class TestCollectionPortlet(CollectionPortletTestCase):


Expand Down Expand Up @@ -255,4 +268,4 @@ def testPortlet(self):


# set the target_collection to /, so we should get an empty result # set the target_collection to /, so we should get an empty result
collectionrenderer.data.target_collection = '/' collectionrenderer.data.target_collection = '/'
self.assertEqual(len(collectionrenderer.results()), 0) self.assertEqual(len(collectionrenderer.results()), 0)

0 comments on commit b8e0ec6

Please sign in to comment.