本文整理汇总了Python中MaKaC.user.Avatar.setId方法的典型用法代码示例。如果您正苦于以下问题:Python Avatar.setId方法的具体用法?Python Avatar.setId怎么用?Python Avatar.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.user.Avatar
的用法示例。
在下文中一共展示了Avatar.setId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testTplCondAccNoneTrack
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def testTplCondAccNoneTrack(self):
# test different possibilities when a condition has been stablished for
# a notif tpl on none track
from MaKaC.review import NotificationTemplate
tpl1 = NotificationTemplate()
absMgr = self._conf.getAbstractMgr()
absMgr.addNotificationTpl(tpl1)
from MaKaC.review import NotifTplCondAccepted
cond1 = NotifTplCondAccepted(track=None, 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) is None)
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, None, self._contribTypeOral)
self.assert_(absMgr.getNotifTplForAbstract(abs3) == tpl1)
示例2: test
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def test(self):
idx=SCIndex()
c1=Avatar()
c1.setId("1")
s1=Session()
idx.index(c1,s1)
self.assert_(s1 in idx.getSessions(c1))
self.assert_(len(idx.getSessions(c1))==1)
c2=Avatar()
c2.setId("2")
idx.index(c2,s1)
self.assert_(s1 in idx.getSessions(c1))
self.assert_(len(idx.getSessions(c1))==1)
self.assert_(s1 in idx.getSessions(c2))
self.assert_(len(idx.getSessions(c2))==1)
s2=Session()
idx.index(c2,s2)
self.assert_(s1 in idx.getSessions(c1))
self.assert_(len(idx.getSessions(c1))==1)
self.assert_(s1 in idx.getSessions(c2))
self.assert_(s2 in idx.getSessions(c2))
self.assert_(len(idx.getSessions(c2))==2)
idx.unindex(c2,s2)
self.assert_(s1 in idx.getSessions(c1))
self.assert_(len(idx.getSessions(c1))==1)
self.assert_(s1 in idx.getSessions(c2))
self.assert_(s2 not in idx.getSessions(c2))
self.assert_(len(idx.getSessions(c2))==1)
示例3: testBasic
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
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)
示例4: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp( self ):
from MaKaC.user import Avatar
a = Avatar()
a.setId("creator")
from MaKaC.conference import Conference
self._conf = Conference( a )
self._conf.setTimezone('UTC')
示例5: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp( self ):
a = Avatar()
a.setId("creator")
self._categ = Category()
self._conf = Conference( a )
self._conf.setId('a')
self._conf.setDates(datetime(2000, 01, 01, tzinfo=timezone("UTC")),datetime(2020, 01, 01, tzinfo=timezone("UTC")))
示例6: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp(self):
super(TestAbstractSubmission, self).setUp()
self._startDBReq()
# Create few users
ah = AvatarHolder()
# Create dummy avatars in obj._avatarN
self._avatars = []
for i in xrange(1, 5):
avatar = Avatar()
avatar.setName("fake-%d" % i)
avatar.setSurName("fake")
avatar.setOrganisation("fake")
avatar.setLang("en_GB")
avatar.setEmail("fake%[email protected]" % i)
avatar.setId("fake-%d" % i)
ah.add(avatar)
self._avatars.append(avatar)
setattr(self, '_avatar%d' % i, avatar)
# Create a conference
category = conference.CategoryManager().getById('0')
self._conf = category.newConference(self._avatar1)
self._conf.setTimezone('UTC')
sd = datetime(2011, 11, 1, 10, 0, tzinfo=timezone('UTC'))
ed = datetime(2011, 11, 1, 18, 0, tzinfo=timezone('UTC'))
self._conf.setDates(sd, ed)
ch = ConferenceHolder()
ch.add(self._conf)
self._stopDBReq()
示例7: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp(self):
super(TestAuthentication, self).setUp()
with self._context("database"):
# Create few users and groups
gh = GroupHolder()
ah = AvatarHolder()
self._authMgr = AuthenticatorMgr()
for i in xrange(1, 3):
group = Group()
group.setName("fake-group-%d" % i)
group.setDescription("fake")
group.setEmail("fake-group-%[email protected]" % i)
group.setId("fake-group-%d" % i)
avatar = Avatar()
avatar.setName("fake-%d" % i)
avatar.setSurName("fake")
avatar.setOrganisation("fake")
avatar.setLang("en_GB")
avatar.setEmail("fake%[email protected]" % i)
avatar.setId("fake-%d" % i)
avatar.activateAccount()
group.addMember(avatar)
ah.add(avatar)
gh.add(group)
identity = self._authMgr.createIdentity(LoginInfo("fake-%d" % i, "fake-%d" % i), avatar, "Local")
self._authMgr.add(identity)
示例8: testTplConditions
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
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)
示例9: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp( self ):
from MaKaC.user import Avatar
a = Avatar()
a.setId("creator")
from MaKaC.conference import Conference
self._conf=Conference(a)
self._conf.setTimezone('UTC')
self._conf.setDates(datetime(2000,1,1,tzinfo=timezone('UTC')),datetime(2020,1,1,tzinfo=timezone('UTC')))
示例10: testAddTC
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def testAddTC( self ):
from MaKaC.user import Avatar
tc1 = Avatar()
tc1.setId( "tc1" )
self._track1.addCoordinator( tc1 )
self.assert_( len(self._track1.getCoordinatorList()) == 1 )
self.assert_( tc1 in self._track1.getCoordinatorList() )
self.assert_( self._track1 in self._conf.getCoordinatedTracks( tc1 ) )
示例11: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp(self):
a = Avatar()
a.setId("creator")
self._conf=Conference(a)
self._conf.setTimezone('UTC')
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)
示例12: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp( self ):
a = Avatar()
a.setId("creator")
self._conf = ConferenceFacade( a )
self._conf.setId('a')
self._conf.setTimezone('UTC')
self._conf.setDates(datetime(2009, 9, 21, 16, 0 ,0, tzinfo=timezone("UTC")), datetime(2009, 9, 21, 19, 0 ,0, tzinfo=timezone("UTC")))
示例13: setUp
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
def setUp( self ):
from MaKaC.user import Avatar
cr = Avatar()
cr.setId( "creator" )
from MaKaC.conference import Conference, Track
self._conf = Conference( cr )
self._track1 = Track()
self._track1.setId( "1" )
self._conf.addTrack( self._track1 )
示例14: TestBasicManagement
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [as 别名]
class TestBasicManagement(unittest.TestCase):
"""Tests the basic conference management functions
"""
def setUp( self ):
self._creator=Avatar()
self._creator.setId("creator")
self._conf=Conference(self._creator)
self._conf.setTimezone('UTC')
confTZ = self._conf.getTimezone()
sd = timezone(confTZ).localize(datetime(2000, 1, 1))
sdUTC = sd.astimezone(timezone('UTC'))
ed = timezone(confTZ).localize(datetime(2020, 1, 1))
edUTC = ed.astimezone(timezone('UTC'))
self._conf.setDates(sdUTC,edUTC)
def testAddRemoveSessions(self):
s1,s2=Session(),Session()
self._conf.addSession(s1)
self._conf.addSession(s2)
self.assert_(s1 in self._conf.getSessionList())
self.assert_(s1==self._conf.getSessionById(s1.getId()))
self.assert_(s2 in self._conf.getSessionList())
self.assert_(s2==self._conf.getSessionById(s2.getId()))
self._conf.removeSession(s1)
self.assert_(s1 not in self._conf.getSessionList())
self.assert_(None==self._conf.getSessionById(s1.getId()))
self.assert_(s2 in self._conf.getSessionList())
self.assert_(s2==self._conf.getSessionById(s2.getId()))
c1,c2,c3=Contribution(),Contribution(),Contribution()
self._conf.addSession(s1)
s1.addContribution(c1)
s1.addContribution(c2)
s2.addContribution(c3)
self.assert_(s1 in self._conf.getSessionList())
self.assert_(s1==self._conf.getSessionById(s1.getId()))
self.assert_(s2 in self._conf.getSessionList())
self.assert_(s2==self._conf.getSessionById(s2.getId()))
self.assert_(c1 in self._conf.getContributionList())
self.assert_(c2 in self._conf.getContributionList())
self.assert_(c3 in self._conf.getContributionList())
self.assert_(c1 in s1.getContributionList())
self.assert_(c2 in s1.getContributionList())
self.assert_(c3 in s2.getContributionList())
self._conf.removeSession(s1)
self.assert_(s1 not in self._conf.getSessionList())
self.assert_(s2 in self._conf.getSessionList())
self.assert_(c1 in self._conf.getContributionList())
self.assert_(c2 in self._conf.getContributionList())
self.assert_(c3 in self._conf.getContributionList())
self.assert_(c1 not in s1.getContributionList())
self.assert_(c1.getSession()==None)
self.assert_(c2.getSession()==None)
self.assert_(c2 not in s1.getContributionList())
self.assert_(c3 in s2.getContributionList())
示例15: TestSubmissionPrivileges
# 需要导入模块: from MaKaC.user import Avatar [as 别名]
# 或者: from MaKaC.user.Avatar import setId [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))