当前位置: 首页>>代码示例>>Python>>正文


Python Conference.getTimezone方法代码示例

本文整理汇总了Python中MaKaC.conference.Conference.getTimezone方法的典型用法代码示例。如果您正苦于以下问题:Python Conference.getTimezone方法的具体用法?Python Conference.getTimezone怎么用?Python Conference.getTimezone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaKaC.conference.Conference的用法示例。


在下文中一共展示了Conference.getTimezone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestBasicManagement

# 需要导入模块: from MaKaC.conference import Conference [as 别名]
# 或者: from MaKaC.conference.Conference import getTimezone [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())
开发者ID:lukasnellen,项目名称:indico,代码行数:58,代码来源:testConferences.py


注:本文中的MaKaC.conference.Conference.getTimezone方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。