Changeset 3556 in products
- Timestamp:
- Sep 14, 2012 10:16:29 AM (12 years ago)
- Location:
- quintagroup.portlet.collection/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/browser/configlet.py
r1572 r3556 23 23 title = schema.TextLine(title=u"title", required=False) 24 24 25 25 26 class ValueTitlePair(object): 26 27 implements(IValueTitlePair) 28 27 29 def __init__(self, value='', title=''): 28 30 self.value = value 29 31 self.title = title 32 30 33 31 34 class IQCollectionPortletPanelSchema(Interface): … … 40 43 ) 41 44 45 42 46 class QCollectionPortletControlPanelAdapter(SchemaAdapterBase): 43 47 adapts(IPloneSiteRoot) … … 50 54 51 55 def get_portlet_dropdown(self): 52 return [ValueTitlePair(v,t) for (v,t) in getStylesVocabulary(self.context)] 56 return [ValueTitlePair(v, t) for (v, t) in getStylesVocabulary( 57 self.context)] 53 58 54 59 def set_portlet_dropdown(self, value): … … 79 84 subwidget=valuetitle_widget) 80 85 86 81 87 class QCollectionPortletControlPanel(ControlPanelForm): 82 88 … … 86 92 label = _("QCollection portlet settings") 87 93 description = _("This form is for managing QCollection portlet " 88 94 "classes available on portlet add/edit form.") 89 95 form_name = _("QCollection portlet settings") -
quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/tests/base.py
r2755 r3556 6 6 from Products.PloneTestCase import PloneTestCase as ptc 7 7 from Products.PloneTestCase.layer import onsetup 8 8 9 9 10 @onsetup … … 34 35 ptc.setupPloneSite(products=['quintagroup.portlet.collection']) 35 36 37 36 38 class TestCase(ptc.PloneTestCase): 37 39 """Base class used for test cases 38 40 """ 39 41 42 40 43 class FunctionalTestCase(ptc.FunctionalTestCase): 41 44 """Test case class used for functional (doc-)tests -
quintagroup.portlet.collection/trunk/quintagroup/portlet/collection/tests/test_portlet.py
r3555 r3556 195 195 196 196 def testRandomQuery(self): 197 # we're being perhaps a bit too clever in random mode with the internals of the198 # LazyMap returned by the collection query, so let's try a bunch of scenarios199 # t o make sure they work197 # we're being perhaps a bit too clever in random mode with the 198 # internals of the LazyMap returned by the collection query, so let's 199 # try a bunch of scenarios to make sure they work 200 200 201 201 def reset_memoize(inst): 202 # Decorator memoize adds attribute 202 # Decorator memoize adds attribute('_memojito_') to class instance. 203 203 # It has cached function and their values so it should be deleted 204 204 # for testing. … … 222 222 getattr(self.folder, 'folder_%s' % i).reindexObject() 223 223 224 # collection with no criteria -- should return empty list, without error 224 # collection with no criteria -- should return empty list, without 225 # error 225 226 self.assertEqual(len(collectionrenderer.results()), 0) 226 227 reset_memoize(collectionrenderer) … … 253 254 collectionrenderer.results() 254 255 255 # collection with sorting -- should behave similarly (sort is ignored internally) 256 # collection with sorting -- should behave similarly (sort is 257 # ignored internally) 256 258 self.folder.collection.setSortCriterion('modified', False) 257 259 self.assertEqual(len(collectionrenderer.results()), 1) 258 260 reset_memoize(collectionrenderer) 259 261 260 # same criteria, now with limit set to 2 -- should return 2 (random) folders 262 # same criteria, now with limit set to 2 -- should return 2 (random) 263 # folders 261 264 collectionrenderer.data.limit = 2 262 265 self.assertEqual(len(collectionrenderer.results()), 2) 263 266 reset_memoize(collectionrenderer) 264 267 265 # make sure there's no error if the limit is greater than the # of results found 268 # make sure there's no error if the limit is greater than the # of 269 # results found 266 270 collectionrenderer.data.limit = 10 267 271 self.failUnless(len(collectionrenderer.results()) >= 6) -
quintagroup.portlet.collection/trunk/setup.py
r3552 r3556 8 8 description="Extended collection portlet", 9 9 long_description=open("README.txt").read() + "\n" + 10 10 open(os.path.join("docs", "HISTORY.txt")).read(), 11 11 # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers 12 12 classifiers=[ 13 "Programming Language :: Python",14 "Topic :: Software Development :: Libraries :: Python Modules",15 13 "Programming Language :: Python", 14 "Topic :: Software Development :: Libraries :: Python Modules", 15 ], 16 16 keywords='portlet collection quintagroup', 17 17 author='Melnychuk Taras',
Note: See TracChangeset
for help on using the changeset viewer.