class UtilsTest(FunctionalTestCase): def setUp(self): super(UtilsTest, self).setUp() self.util = RedmineUtil() def test_getIssue(self): initialize_mock() r = self.util.getIssue(123, include='journals') self.assertEqual(r.subject, 'Some subject 1') self.assertEqual(r.description, 'some description 1') def test_getUser(self): initialize_mock() u = self.util.getUser(123) self.assertEqual(u.firstname, 'Marcin') self.assertEqual(u.lastname, 'Staniszczak') self.assertEqual(u.mail, '*****@*****.**')
from zope.formlib import form from zope.interface import implements from zope import schema from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile from plone.portlets.interfaces import IPortletDataProvider from plone.app.portlets.portlets import base from vnccollab.redmine import messageFactory as _ from vnccollab.redmine.util import RedmineUtil, logException from vnccollab.common.portlets import deferred logger = logging.getLogger('vnccollab.redmine.RedmineTicketsPortlet') util = RedmineUtil() class IRedmineTicketsPortlet(IPortletDataProvider): header = schema.TextLine( title=_(u"Header"), description=_(u"Header of the portlet."), required=True, default=u'Redmine Tickets') count = schema.Int( title=_(u"Number of items to display"), description=_(u"How many items to list."), required=True, default=5)
def setUp(self): super(UtilsTest, self).setUp() self.util = RedmineUtil()