本文整理汇总了Python中MaKaC.conference.Conference.getAbstractMgr方法的典型用法代码示例。如果您正苦于以下问题:Python Conference.getAbstractMgr方法的具体用法?Python Conference.getAbstractMgr怎么用?Python Conference.getAbstractMgr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.conference.Conference
的用法示例。
在下文中一共展示了Conference.getAbstractMgr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestSubmissionPrivileges
# 需要导入模块: from MaKaC.conference import Conference [as 别名]
# 或者: from MaKaC.conference.Conference import getAbstractMgr [as 别名]
class TestSubmissionPrivileges(unittest.TestCase):
"""Tests different scenarios concerning the material submission privileges
"""
def setUp( self ):
self._creator=Avatar()
self._creator.setId("creator")
self._conf=Conference(self._creator)
sd=datetime(2004, 01, 01, 10, 00, tzinfo=timezone("UTC"))
ed=datetime(2004, 01, 05, 10, 00, tzinfo=timezone("UTC"))
self._conf.setDates(sd,ed)
def testBasic(self):
c1=Contribution()
self._conf.addContribution(c1)
av1,av2=Avatar(),Avatar()
av1.setId("1")
av2.setId("2")
self.assert_(not c1.canUserSubmit(av1))
self.assert_(not c1.canUserSubmit(av2))
self.assert_(len(c1.getSubmitterList())==0)
c1.grantSubmission(av1)
self.assert_(c1.canUserSubmit(av1))
self.assert_(not c1.canUserSubmit(av2))
self.assert_(len(c1.getSubmitterList())==1)
self.assert_(av1 in c1.getSubmitterList())
self.assert_(av2 not in c1.getSubmitterList())
c1.revokeSubmission(av2)
self.assert_(c1.canUserSubmit(av1))
self.assert_(not c1.canUserSubmit(av2))
self.assert_(len(c1.getSubmitterList())==1)
self.assert_(av1 in c1.getSubmitterList())
self.assert_(av2 not in c1.getSubmitterList())
c1.revokeSubmission(av1)
self.assert_(not c1.canUserSubmit(av1))
self.assert_(not c1.canUserSubmit(av2))
self.assert_(len(c1.getSubmitterList())==0)
def testAccContrib(self):
#tests that when a contribution comes from an accepted abstract the
# abstract submitters are also granted with submission privileges
# for the contribution
av1=Avatar()
av1.setId("1")
av2=Avatar()
av2.setId("2")
abs=self._conf.getAbstractMgr().newAbstract(av1)
abs.accept(self._creator,None,None)
c=abs.getContribution()
self.assert_(c.canUserSubmit(av1))
self.assert_(not c.canUserSubmit(av2))
c.grantSubmission(av2)
self.assert_(c.canUserSubmit(av1))
self.assert_(c.canUserSubmit(av2))
示例2: TestNotification
# 需要导入模块: from MaKaC.conference import Conference [as 别名]
# 或者: from MaKaC.conference.Conference import getAbstractMgr [as 别名]
class TestNotification(unittest.TestCase):
"""
"""
def setUp(self):
from MaKaC.user import Avatar
av = Avatar()
from MaKaC.conference import Conference
self._conf = Conference(av)
self._track1 = self._conf.newTrack()
self._track2 = self._conf.newTrack()
self._track3 = self._conf.newTrack()
absMgr = self._conf.getAbstractMgr()
self._contribTypeOral = "oral"
self._contribTypePoster = "poster"
# absMgr.addContribType(self._contribTypeOral)
# absMgr.addContribType(self._contribTypePoster)
# from MaKaC.user import Avatar
# self._submitter = Avatar()
# self._submitter.setId( "submitter" )
# self._abstract=self._conf.getAbstractMgr().newAbstract(self._submitter)
# self._abstract.addTrack(self._track1)
def testBasicManagement(self):
# test adding and removing notification templates
from MaKaC.review import NotificationTemplate
tpl1 = NotificationTemplate()
absMgr = self._conf.getAbstractMgr()
absMgr.addNotificationTpl(tpl1)
self.assert_(tpl1 in absMgr.getNotificationTplList())
tpl2 = NotificationTemplate()
absMgr.addNotificationTpl(tpl2)
absMgr.removeNotificationTpl(tpl1)
self.assert_(tpl2 in absMgr.getNotificationTplList())
self.assert_(tpl1 not in absMgr.getNotificationTplList())
self.assert_(tpl1 != absMgr.getNotificationTplById(tpl1.getId()))
self.assert_(tpl2 == absMgr.getNotificationTplById(tpl2.getId()))
def testTplConditions(self):
# test adding and removing conditions to templates
from MaKaC.review import NotificationTemplate
tpl1 = NotificationTemplate()
tpl2 = NotificationTemplate()
absMgr = self._conf.getAbstractMgr()
absMgr.addNotificationTpl(tpl1)
absMgr.addNotificationTpl(tpl2)
from MaKaC.review import NotifTplCondAccepted, NotifTplCondRejected
cond1 = NotifTplCondAccepted(contribType=self._contribTypeOral)
cond2 = NotifTplCondRejected()
tpl1.addCondition(cond1)
tpl2.addCondition(cond2)
from MaKaC.user import Avatar
submitter = Avatar()
submitter.setId("submitter")
abs1 = absMgr.newAbstract(submitter)
tplRes = absMgr.getNotifTplForAbstract(abs1)
self.assert_(tplRes is None)
abs1.accept(submitter, self._track1, self._contribTypeOral)
self.assert_(absMgr.getNotifTplForAbstract(abs1) == tpl1)
abs2 = absMgr.newAbstract(submitter)
abs2.accept(submitter, self._track1, self._contribTypePoster)
self.assert_(not absMgr.getNotifTplForAbstract(abs2))
abs3 = absMgr.newAbstract(submitter)
abs3.reject(submitter)
self.assert_(absMgr.getNotifTplForAbstract(abs3) == tpl2)
def testTplCondAccTrack(self):
# test different possibilities when a condition has been stablished for
# a certain track
from MaKaC.review import NotificationTemplate
tpl1 = NotificationTemplate()
absMgr = self._conf.getAbstractMgr()
absMgr.addNotificationTpl(tpl1)
from MaKaC.review import NotifTplCondAccepted
cond1 = NotifTplCondAccepted(track=self._track1, contribType=self._contribTypeOral)
tpl1.addCondition(cond1)
from MaKaC.user import Avatar
submitter = Avatar()
submitter.setId("submitter")
abs1 = absMgr.newAbstract(submitter)
abs1.accept(submitter, self._track1, self._contribTypeOral)
self.assert_(absMgr.getNotifTplForAbstract(abs1) == tpl1)
abs2 = absMgr.newAbstract(submitter)
abs2.accept(submitter, self._track1, self._contribTypePoster)
self.assert_(absMgr.getNotifTplForAbstract(abs2) is None)
abs3 = absMgr.newAbstract(submitter)
abs3.accept(submitter, self._track2, self._contribTypeOral)
self.assert_(absMgr.getNotifTplForAbstract(abs3) is None)
def testTplCondAccAnyTrack(self):
# test different possibilities when a condition has been stablished for
#.........这里部分代码省略.........