def test_js(self): widget = MultiContentSearchWidget(self.request) widget.context = self.obj widget.name = "test" widget.field = List(value_type=Choice(title=u"Selection", source=PathSourceBinder(portal_type="Document"))) result = widget.js_extra() self.assertIn("$('#test-widgets-query').each(function()", result)
def test_js(self): widget = MultiContentSearchWidget(self.request) widget.context = self.obj widget.name = 'test' widget.field = List(value_type=Choice(title=u"Selection", source=PathSourceBinder(portal_type='Document'))) result = widget.js_extra() self.assertIn('$(\'#test-widgets-query\').each(function()', result)
def test_js(self): portal = self.portal ttool = getToolByName(self.portal, 'portal_types') setRoles(self.portal, TEST_USER_ID, ['Manager']) fti = ttool.getTypeInfo("Document") obj = fti.constructInstance(portal, "test1") widget = MultiContentSearchWidget(self.request) widget.context = obj widget.name = 'test' widget.field = List(value_type=Choice(title=u"Selection", source=PathSourceBinder(portal_type='Document'))) result = widget.js_extra() self.assertIn('$(\'#test-widgets-query\').each(function()', result)