示例#1
0
    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("*****@*****.**" % 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()
示例#2
0
    def setUp(self):
        super(TestAbstractJudgements, self).setUp()

        self._startDBReq()

        # Get dummy user and create another one
        ah = AvatarHolder()
        avatar1 = ah.getById(0)
        avatar2 = Avatar()
        avatar2.setName("fake-2")
        avatar2.setSurName("fake")
        avatar2.setOrganisation("fake")
        avatar2.setLang("en_GB")
        avatar2.setEmail("*****@*****.**")
        avatar2.setId("fake-2")
        ah.add(avatar2)
        setattr(self, '_avatar1', avatar1)
        setattr(self, '_avatar2', avatar2)

        # 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._ctOral = conference.ContributionType("oral", "", self._conf)
        self._conf.addContribType(self._ctOral)

        self._track1 = self._conf.newTrack()
        self._track2 = self._conf.newTrack()
        self._track3 = self._conf.newTrack()

        self._abstract1 = self._conf.getAbstractMgr().newAbstract(
            self._avatar1)
        self._abstract2 = self._conf.getAbstractMgr().newAbstract(
            self._avatar1)
        self._abstract3 = self._conf.getAbstractMgr().newAbstract(
            self._avatar1)
        self._abstract4 = self._conf.getAbstractMgr().newAbstract(
            self._avatar1)
        self._abstract5 = self._conf.getAbstractMgr().newAbstract(
            self._avatar1)

        self._abstract1.setTracks([self._track1, self._track2, self._track3])
        self._abstract2.setTracks([self._track1, self._track2])
        self._abstract3.setTracks([self._track1])
        self._abstract4.setTracks([self._track2, self._track3])
        self._abstract5.setTracks([self._track3])

        self._stopDBReq()
示例#3
0
    def setUp(self):
        super(TestProtection, self).setUp()

        self._startDBReq()

        # Create a user
        ah = AvatarHolder()
        self._avatar = Avatar()
        self._avatar.setName("fake")
        self._avatar.setSurName("fake")
        self._avatar.setOrganisation("fake")
        self._avatar.setLang("en_GB")
        self._avatar.setEmail("*****@*****.**")
        self._avatar.setId("fake")
        ah.add(self._avatar)

        # Create a conference
        category = conference.CategoryManager().getById('0')
        self._conf = category.newConference(self._avatar)
        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._contrib1 = conference.Contribution()
        self._conf.addContribution(self._contrib1)

        self._session1 = conference.Session()
        self._conf.addSession(self._session1)

        self._session2 = conference.Session()
        self._conf.addSession(self._session2)

        self._contrib2 = conference.Contribution()
        self._session1.addContribution(self._contrib2)


        #Now we create the material (id=0) and attach it to the contrib
        self._material = conference.Material()
        self._contrib1.addMaterial( self._material )
        #Now we create a dummy file and attach it to the material
        filePath = os.path.join( os.getcwd(), "test.txt" )
        fh = open(filePath, "w")
        fh.write("hola")
        fh.close()
        self._resource = conference.LocalFile()
        self._resource.setFilePath( filePath )
        self._resource.setFileName( "test.txt" )
        self._material.addResource( self._resource )

        self._stopDBReq()
示例#4
0
    def setUp(self):
        super(TestProtection, self).setUp()

        self._startDBReq()

        # Create a user
        ah = AvatarHolder()
        self._avatar = Avatar()
        self._avatar.setName("fake")
        self._avatar.setSurName("fake")
        self._avatar.setOrganisation("fake")
        self._avatar.setLang("en_GB")
        self._avatar.setEmail("*****@*****.**")
        self._avatar.setId("fake")
        ah.add(self._avatar)

        # Create a conference
        category = conference.CategoryManager().getById('0')
        self._conf = category.newConference(self._avatar)
        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._contrib1 = conference.Contribution()
        self._conf.addContribution(self._contrib1)

        self._session1 = conference.Session()
        self._conf.addSession(self._session1)

        self._session2 = conference.Session()
        self._conf.addSession(self._session2)

        self._contrib2 = conference.Contribution()
        self._session1.addContribution(self._contrib2)

        #Now we create the material (id=0) and attach it to the contrib
        self._material = conference.Material()
        self._contrib1.addMaterial(self._material)
        #Now we create a dummy file and attach it to the material
        filePath = os.path.join(os.getcwd(), "test.txt")
        fh = open(filePath, "w")
        fh.write("hola")
        fh.close()
        self._resource = conference.LocalFile()
        self._resource.setFilePath(filePath)
        self._resource.setFileName("test.txt")
        self._material.addResource(self._resource)

        self._stopDBReq()
示例#5
0
    def setUp(self):
        super(TestAbstractJudgements, self).setUp()

        self._startDBReq()

        # Get dummy user and create another one
        ah = AvatarHolder()
        avatar1 = ah.getById(0)
        avatar2 = Avatar()
        avatar2.setName("fake-2")
        avatar2.setSurName("fake")
        avatar2.setOrganisation("fake")
        avatar2.setLang("en_GB")
        avatar2.setEmail("*****@*****.**")
        avatar2.setId("fake-2")
        ah.add(avatar2)
        setattr(self, '_avatar1', avatar1)
        setattr(self, '_avatar2', avatar2)

        # 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._ctOral = conference.ContributionType("oral", "", self._conf)
        self._conf.addContribType(self._ctOral)

        self._track1 = self._conf.newTrack()
        self._track2 = self._conf.newTrack()
        self._track3 = self._conf.newTrack()

        self._abstract1 = self._conf.getAbstractMgr().newAbstract(self._avatar1)
        self._abstract2 = self._conf.getAbstractMgr().newAbstract(self._avatar1)
        self._abstract3 = self._conf.getAbstractMgr().newAbstract(self._avatar1)
        self._abstract4 = self._conf.getAbstractMgr().newAbstract(self._avatar1)
        self._abstract5 = self._conf.getAbstractMgr().newAbstract(self._avatar1)

        self._abstract1.setTracks([self._track1, self._track2, self._track3])
        self._abstract2.setTracks([self._track1, self._track2])
        self._abstract3.setTracks([self._track1])
        self._abstract4.setTracks([self._track2, self._track3])
        self._abstract5.setTracks([self._track3])

        self._stopDBReq()
示例#6
0
    def setUp(self):
        super(TestTasks, self).setUp()
        self._startDBReq()

        PluginsHolder().updateAllPluginInfo()
        PluginsHolder().getPluginType('calendaring').setActive(True)
        PluginsHolder().getPluginType('calendaring').getPlugin(
            'outlook').setActive(True)

        # Create two dummy users
        ah = AvatarHolder()
        self._avatar1 = Avatar()
        self._avatar1.setName("fake-1")
        self._avatar1.setSurName("fake1")
        self._avatar1.setOrganisation("fake1")
        self._avatar1.setEmail("*****@*****.**")
        ah.add(self._avatar1)
        self._avatar2 = Avatar()
        self._avatar2.setName("fake-2")
        self._avatar2.setSurName("fake2")
        self._avatar2.setOrganisation("fake2")
        self._avatar2.setEmail("*****@*****.**")
        ah.add(self._avatar2)

        # Create two dummy conferences
        category = conf.CategoryManager().getById('0')
        ch = ConferenceHolder()

        self._conf1 = category.newConference(self._avatar1)
        self._conf1.setTimezone('UTC')
        sd1 = datetime(2012, 12, 1, 10, 0, tzinfo=timezone('UTC'))
        ed1 = datetime(2012, 12, 1, 18, 0, tzinfo=timezone('UTC'))
        self._conf1.setDates(sd1, ed1)
        ch.add(self._conf1)

        self._conf2 = category.newConference(self._avatar2)
        self._conf2.setTimezone('UTC')
        sd2 = datetime(2012, 12, 10, 11, 0, tzinfo=timezone('UTC'))
        ed2 = datetime(2012, 12, 11, 13, 0, tzinfo=timezone('UTC'))
        self._conf2.setDates(sd2, ed2)
        ch.add(self._conf2)

        self._stopDBReq()
示例#7
0
    def setUp(self):
        super(TestTasks, self).setUp()
        self._startDBReq()

        PluginsHolder().updateAllPluginInfo()
        PluginsHolder().getPluginType('calendaring').setActive(True)
        PluginsHolder().getPluginType('calendaring').getPlugin('outlook').setActive(True)

        # Create two dummy users
        ah = AvatarHolder()
        self._avatar1 = Avatar()
        self._avatar1.setName("fake-1")
        self._avatar1.setSurName("fake1")
        self._avatar1.setOrganisation("fake1")
        self._avatar1.setEmail("*****@*****.**")
        ah.add(self._avatar1)
        self._avatar2 = Avatar()
        self._avatar2.setName("fake-2")
        self._avatar2.setSurName("fake2")
        self._avatar2.setOrganisation("fake2")
        self._avatar2.setEmail("*****@*****.**")
        ah.add(self._avatar2)

        # Create two dummy conferences
        category = conf.CategoryManager().getById('0')
        ch = ConferenceHolder()

        self._conf1 = category.newConference(self._avatar1)
        self._conf1.setTimezone('UTC')
        sd1 = datetime(2012, 12, 1, 10, 0, tzinfo=timezone('UTC'))
        ed1 = datetime(2012, 12, 1, 18, 0, tzinfo=timezone('UTC'))
        self._conf1.setDates(sd1, ed1)
        ch.add(self._conf1)

        self._conf2 = category.newConference(self._avatar2)
        self._conf2.setTimezone('UTC')
        sd2 = datetime(2012, 12, 10, 11, 0, tzinfo=timezone('UTC'))
        ed2 = datetime(2012, 12, 11, 13, 0, tzinfo=timezone('UTC'))
        self._conf2.setDates(sd2, ed2)
        ch.add(self._conf2)

        self._stopDBReq()
    def setUp(self):
        '''
        Create a conference, 0
        Add 2 contributions to this conference, 0 and 1
        To contribution 0 - Add 2 speakers, person1 and person2
        To contribution 1 - Add 1 speaker, person1
        '''
        super(TestElectronicAgreement, self).setUp()
        with self._context('database', 'request'):

            # Create few users
            self._creator = Avatar({"name":"God", "email":"*****@*****.**"})
            self._creator.setId("creator")
                # Set God as admin
            AdminList.getInstance().getList().append(self._creator)

            self.person1 = Avatar({"name":"giuseppe", "email":"*****@*****.**"})
            self.person1.setId("spk1")
            self.person2 = Avatar({"name":"gabriele", "email":"*****@*****.**"})
            self.person1.setId("spk2")
            self.person3 = Avatar({"name":"lorenzo", "email":"*****@*****.**"})
            self.person1.setId("spk3")
            self.person4 = Avatar({"name":"silvio", "email":"*****@*****.**"})
            self.person1.setId("spk4")

            ah = AvatarHolder()
            ah.add(self.person1)
            ah.add(self.person2)
            ah.add(self.person3)
            ah.add(self.person4)

            # Create a conference
            category = conference.CategoryManager().getById('0')
            self._conf = category.newConference(self._creator)
            self._conf.setTimezone('UTC')
            sd=datetime(2011, 06, 01, 10, 00, tzinfo=timezone("UTC"))
            ed=datetime(2011, 06, 05, 10, 00, tzinfo=timezone("UTC"))
            self._conf.setDates(sd,ed,)
            ch = ConferenceHolder()
            ch.add(self._conf)

            # Create contributions and add to the conference
            c1, c2 = Contribution(), Contribution()
            self.speaker1, self.speaker2 = ContributionParticipation(), ContributionParticipation()

            self.speaker1.setDataFromAvatar(self.person1)
            self.speaker2.setDataFromAvatar(self.person2)

            self._conf.addContribution(c2)
            self._conf.addContribution(c1)

            # Add speakers to contributions
            c1.addPrimaryAuthor(self.speaker1)
            c2.addPrimaryAuthor(self.speaker2)
            c1.addSpeaker(self.speaker1)
            c2.addSpeaker(self.speaker1)
            c2.addSpeaker(self.speaker2)

            self._conf.enableSessionSlots()

            # Create session and schedule the contributions
            s1 = Session()
            sd = datetime(2011, 06, 02, 12, 00, tzinfo=timezone("UTC"))
            ed = datetime(2011, 06, 02, 19, 00, tzinfo=timezone("UTC"))
            s1.setDates(sd, ed)

            slot1 = SessionSlot(s1)
            self._conf.addSession(s1)
            slot1.setValues({"sDate":sd})
            s1.addSlot(slot1)

            s1.addContribution(c1)
            s1.addContribution(c2)
            slot1.getSchedule().addEntry(c1.getSchEntry())
            slot1.getSchedule().addEntry(c2.getSchEntry())
            self.createAndAcceptBooking()
    def setUp(self):
        '''
        Create a conference, 0
        Add 2 contributions to this conference, 0 and 1
        To contribution 0 - Add 2 speakers, person1 and person2
        To contribution 1 - Add 1 speaker, person1
        '''
        super(TestElectronicAgreement, self).setUp()

        self._startDBReq()

        self.falseSession = FalseSession()
        # Create few users
        self._creator = Avatar({"name": "God", "email": "*****@*****.**"})
        self._creator.setId("creator")
        # Set God as admin
        AdminList.getInstance().getList().append(self._creator)

        self.person1 = Avatar({"name": "giuseppe", "email": "*****@*****.**"})
        self.person1.setId("spk1")
        self.person2 = Avatar({"name": "gabriele", "email": "*****@*****.**"})
        self.person1.setId("spk2")
        self.person3 = Avatar({"name": "lorenzo", "email": "*****@*****.**"})
        self.person1.setId("spk3")
        self.person4 = Avatar({"name": "silvio", "email": "*****@*****.**"})
        self.person1.setId("spk4")

        ah = AvatarHolder()
        ah.add(self.person1)
        ah.add(self.person2)
        ah.add(self.person3)
        ah.add(self.person4)

        # Create a conference
        category = conference.CategoryManager().getById('0')
        self._conf = category.newConference(self._creator)
        self._conf.setTimezone('UTC')
        sd = datetime(2011, 06, 01, 10, 00, tzinfo=timezone("UTC"))
        ed = datetime(2011, 06, 05, 10, 00, tzinfo=timezone("UTC"))
        self._conf.setDates(
            sd,
            ed,
        )
        ch = ConferenceHolder()
        ch.add(self._conf)

        # Create contributions and add to the conference
        c1, c2 = Contribution(), Contribution()
        self.speaker1, self.speaker2 = ContributionParticipation(
        ), ContributionParticipation()

        self.speaker1.setDataFromAvatar(self.person1)
        self.speaker2.setDataFromAvatar(self.person2)

        self._conf.addContribution(c2)
        self._conf.addContribution(c1)

        # Add speakers to contributions
        c1.addPrimaryAuthor(self.speaker1)
        c2.addPrimaryAuthor(self.speaker2)
        c1.addSpeaker(self.speaker1)
        c2.addSpeaker(self.speaker1)
        c2.addSpeaker(self.speaker2)

        self._conf.enableSessionSlots()

        # Create session and schedule the contributions
        s1 = Session()
        sd = datetime(2011, 06, 02, 12, 00, tzinfo=timezone("UTC"))
        ed = datetime(2011, 06, 02, 19, 00, tzinfo=timezone("UTC"))
        s1.setDates(sd, ed)

        slot1 = SessionSlot(s1)
        self._conf.addSession(s1)
        slot1.setValues({"sDate": sd})
        s1.addSlot(slot1)

        s1.addContribution(c1)
        s1.addContribution(c2)
        slot1.getSchedule().addEntry(c1.getSchEntry())
        slot1.getSchedule().addEntry(c2.getSchEntry())

        self.createAndAcceptBooking()
        self._stopDBReq()