Esempio n. 1
0
    def test_expenses_summary(self):
        self.create_conference()
        self.create_talks()

        submissions = [
            submissionrecord.make_submission_plus(self.t1.key, self.c.key,
                                                  "Track", "format",
                                                  "duration",
                                                  "World wide").get(),
            submissionrecord.make_submission_plus(self.t2.key, self.c.key,
                                                  "Track", "format",
                                                  "duration", "Local").get(),
            submissionrecord.make_submission_plus(self.t3.key, self.c.key,
                                                  "Track", "format",
                                                  "duration", "None").get(),
            submissionrecord.make_submission_plus(self.t4.key, self.c.key,
                                                  "Track", "format",
                                                  "duration", "Local").get(),
        ]

        expenses = submissions_aux.expenses_summary(submissions)

        self.assertEqual(len(expenses), 3)
        self.assertEqual(expenses["World wide"], 1)
        self.assertEqual(expenses["None"], 1)
        self.assertEqual(expenses["Local"], 2)
Esempio n. 2
0
    def test_export_submissions_list(self):
        c = conference.Conference()
        c.name = "TestConf"
        c.put()
        track1 = confoptions.make_conference_track(c.key, "track")
        track2 = confoptions.make_conference_track(c.key, "another track")
        format1 = confoptions.make_conference_option(confoptions.TalkFormatOption, c.key, "lecture")
        duration1 = confoptions.make_conference_option(confoptions.DurationOption, c.key, "10mins")
        expenses1 = confoptions.make_conference_option(confoptions.ExpenseOptions, c.key, "Money")

        s = speaker.make_new_speaker("*****@*****.**")
        s.put()
        t = talk.Talk(parent=s.key)
        t.title = "A testing talk"
        t.put()
        sub_key = submissionrecord.make_submission_plus(t.key, c.key, track1.shortname(),
                                                        format1.shortname(), duration1.shortname(),
                                                        expenses1.shortname())

        s2 = speaker.make_new_speaker("*****@*****.**")
        s2.put()
        t2 = talk.Talk(parent=s2.key)
        t2.title = "Knowing Rimmer"
        t2.put()
        sub_key2 = submissionrecord.make_submission_plus(t2.key, c.key, track2.shortname(),
                                                         format1.shortname(), duration1.shortname(),
                                                         expenses1.shortname())

        output = MockOutStream()
        exportcsv.write_sub_list(output, [sub_key, sub_key2])
        self.assertEquals(output.number_of_writes(), 38)
Esempio n. 3
0
    def test_post_many(self, mock_deferred_func):
        c, sub_key1 = self.common_setup()

        t2 = talk.Talk()
        t2.title = "Talk T2"
        t2.put()
        sub_key2 = submissionrecord.make_submission_plus(
            t2.key, c.key, "track", "format", "time", "exp")

        t3 = talk.Talk()
        t3.title = "Talk T3"
        t3.put()
        sub_key3 = submissionrecord.make_submission_plus(
            t3.key, c.key, "track", "format", "time", "exp")

        accept = msgtemplate.retrieveTemplate(msgtemplate.AcceptMsg, c.key)
        try:
            postmail.Postman().post_many(
                c,
                accept, [sub_key1.get(),
                         sub_key2.get(),
                         sub_key3.get()],
                send_gap_seconds=10)
        except:
            self.assertTrue(False, "Exception rasied unexpectedly")
        else:
            self.assertTrue(True, "Exception not rasied as expected")
Esempio n. 4
0
    def more_subs(self):
        conf_key = self.get_crrt_conference_key()
        conference = conf_key.get()
        track = conference.track_options().keys()[0]
        duration = conference.duration_options().keys()[0]
        format = conference.delivery_format_options().keys()[0]
        expenses = conference.expenses_options().keys()[0]

        skey1 = self.add_test_speaker("Testing 1", "*****@*****.**")
        tkey1 = self.add_test_talk(skey1, "Talk from S1")
        submissionrecord.make_submission_plus(tkey1, conf_key, track, format,
                                              duration, expenses)

        skey2 = self.add_test_speaker("Testing 2", "*****@*****.**")
        tkey2 = self.add_test_talk(skey2, "Talk from S2")
        submissionrecord.make_submission_plus(tkey2, conf_key, track, format,
                                              duration, expenses)

        skey3 = self.add_test_speaker("Testing 3", "*****@*****.**")
        tkey3 = self.add_test_talk(skey3, "Talk from S3")
        submissionrecord.make_submission_plus(tkey3, conf_key, track, format,
                                              duration, expenses)

        skey4 = self.add_test_speaker("Testing 4", "*****@*****.**")
        tkey4 = self.add_test_talk(skey4, "Talk from S4")
        submissionrecord.make_submission_plus(tkey4, conf_key, track, format,
                                              duration, expenses)

        return "/createconf"
Esempio n. 5
0
    def test_retrieve_submission_by_expenses(self):
        self.create_conference()

        sub_key1 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option1")
        sub = sub_key1.get()
        sub.set_expenses_expectation("Long haul")
        sub.put()

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Long haul")
        self.assertEquals(1, len(expenses_list))

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Short haul")
        self.assertEquals(0, len(expenses_list))

        sub_key2 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option1")
        sub = sub_key2.get()
        sub.set_expenses_expectation("Long haul")
        sub.put()

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Long haul")
        self.assertEquals(2, len(expenses_list))

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Short haul")
        self.assertEquals(0, len(expenses_list))

        sub_key3 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option1")
        sub = sub_key3.get()
        sub.set_expenses_expectation("Short haul")
        sub.put()

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Long haul")
        self.assertEquals(2, len(expenses_list))

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Short haul")
        self.assertEquals(1, len(expenses_list))

        # now test for decision too
        no_filter_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "")
        self.assertEquals(3, len(no_filter_list))

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Long haul")
        self.assertEquals(2, len(expenses_list))

        expenses_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "Short haul")
        self.assertEquals(1, len(expenses_list))

        no_filter_list = submissions_aux.retrieve_submissions_by_expenses(self.c.key, "")
        self.assertEquals(3, len(no_filter_list))
Esempio n. 6
0
    def test_change_all_expenses(self):
        self.create_conference()

        sub_key1 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option1")
        sub_key2 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option2")
        sub_key3 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option3")
        sub_key4 = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option2")

        self.assertEquals(len(submissionrecord.retrieve_conference_submissions(self.c.key)), 4)
        submissions_aux.change_all_expenses(self.c.key, "Option2", "NewOption")
        self.assertEquals(len(submissionrecord.retrieve_conference_submissions(self.c.key)), 4)

        self.assertEquals("Option1", sub_key1.get().expenses)
        self.assertEquals("NewOption", sub_key2.get().expenses)
        self.assertEquals("Option3", sub_key3.get().expenses)
        self.assertEquals("NewOption", sub_key4.get().expenses)
Esempio n. 7
0
    def lots_more(self):
        conf_key = self.get_crrt_conference_key()
        conference = conf_key.get()
        tracks = conference.track_options().keys()
        track_count = len(tracks)
        duration = conference.duration_options().keys()[0]
        format = conference.delivery_format_options().keys()[0]
        expenses = conference.expenses_options().keys()[0]

        for i in range(1, int(self.request.get("how_many", "20")) + 1):
            speaker = "Speaker Smith " + str(i)
            semail = "speakersmith" + str(i) + "@reward.com.co"
            skey = self.add_test_speaker(speaker, semail)
            tkey = self.add_test_talk(skey, "Talk from " + speaker)
            submissionrecord.make_submission_plus(tkey, conf_key,
                                                  tracks[i % track_count],
                                                  format, duration, expenses)

        return "/createconf"
Esempio n. 8
0
    def test_export_submission(self):
        c = conference.Conference()
        c.name = "TestConf"
        c.put()
        track1 = confoptions.make_conference_track(c.key, "track")
        format1 = confoptions.make_conference_option(confoptions.TalkFormatOption, c.key, "lecture")
        duration1 = confoptions.make_conference_option(confoptions.DurationOption, c.key, "10mins")
        expenses1 = confoptions.make_conference_option(confoptions.ExpenseOptions, c.key, "Long haul")

        s = speaker.make_new_speaker("*****@*****.**")
        s.name = 'Arnold "J" Rimmer'
        s.telephone = "051 652 0538"
        s.address = "Cabin 42, Deck 3, Red Dwarf"
        s.set_field("affiliation", "Mining Corp")
        s.set_field("twitter", "@arnold")
        s.bio = "Arnold 'J' Rimmer joined Mining Corp (Space Division) at, what now seems, a very young age."
        s.put()

        t = talk.Talk(parent=s.key)
        t.title = "A testing talk"
        t.set_field(talk.SHORT_SYNOPSIS, "A few words about the tests you need")
        t.set_field(talk.LONG_SYNOPSIS, "Many more words about testing.... 1, 2, 3")
        t.put()

        sub_key = submissionrecord.make_submission_plus(t.key, c.key,
                                                        track1.shortname(), format1.shortname(),
                                                        duration1.shortname(), expenses1.shortname())

        cospeak = cospeaker.make_cospeaker(sub_key, "Harry Potter", "*****@*****.**")

        output = MockOutStream()
        exportcsv.write_sub(output, sub_key.get())

        self.assertEquals(output.sequence[0], 'No decision, ')
        self.assertEquals(output.sequence[1], "Arnold 'J' Rimmer, ")
        self.assertEquals(output.sequence[2], '[email protected], ')
        self.assertEquals(output.sequence[3], '051 652 0538, ')
        self.assertEquals(output.sequence[4], '"Cabin 42, Deck 3, Red Dwarf", ')
        self.assertEquals(output.sequence[5], 'Harry Potter, ')
        self.assertEquals(output.sequence[6], ', ')
        self.assertEquals(output.sequence[7], 'Mining Corp, ')
        self.assertEquals(output.sequence[8], '@arnold, ')
        self.assertEquals(output.sequence[9], """"Arnold 'J' Rimmer joined Mining Corp (Space Division) at, what now seems, a very young age.", """)
        self.assertEquals(output.sequence[10], 'None, ')

        self.assertEquals(output.sequence[11], 'A testing talk, ')
        self.assertEquals(output.sequence[12], "A few words about the tests you need, ")
        self.assertEquals(output.sequence[13], '"Many more words about testing.... 1, 2, 3", ')

        self.assertEquals(output.sequence[14], 'track, ')
        self.assertEquals(output.sequence[15], 'lecture, ')
        self.assertEquals(output.sequence[16], '10mins, ')
        self.assertEquals(output.sequence[17], 'Long haul, ')

        self.assertEquals(output.number_of_writes(), 18)
Esempio n. 9
0
    def test_change_expenses(self):
        self.create_conference()

        sub_key = submissionrecord.make_submission_plus(self.t.key, self.c.key, "track", "format", "duration", "Option1")
        self.assertEquals(len(submissionrecord.retrieve_conference_submissions(self.c.key)), 1)

        sub = sub_key.get()
        self.assertEquals("Option1", sub.expenses)
        submissions_aux.change_expenses(sub_key, "NotTheOption", "NewOption")
        self.assertEquals("Option1", sub.expenses)

        submissions_aux.change_expenses(sub_key, "Option1", "NewOption")
        self.assertEquals("NewOption", sub.expenses)
Esempio n. 10
0
    def common_setup(self):
        c = conference.Conference()
        c.name = "TestConf"
        c.put()
        track1 = confoptions.make_conference_track(c.key, "track")
        format1 = confoptions.make_conference_option(
            confoptions.TalkFormatOption, c.key, "lecture")
        duration1 = confoptions.make_conference_option(
            confoptions.DurationOption, c.key, "10mins")
        expenses1 = confoptions.make_conference_option(
            confoptions.ExpenseOptions, c.key, "Money")

        s = speaker.make_new_speaker("arnold@email")
        s.name = "Arnold Rimmer"
        s.put()

        t1 = talk.Talk(parent=s.key)
        t1.title = "Talk T1"
        t1.put()
        sub_key1 = submissionrecord.make_submission_plus(
            t1.key, c.key, track1.shortname(), format1.shortname(),
            duration1.shortname(), expenses1.shortname())
        return c, sub_key1
Esempio n. 11
0
    def test_excel_export_with_multiple_rows(self, mock_storage_open,
                                             mock_sheet_write):
        sub_report_key = customexport.mk_report(self.conf.key,
                                                "MultipleRowsReport")
        sub_report = sub_report_key.get()
        sub_report.add_submission_options([
            "grdp_agreed", "speaker_comms", "title", "email", "first_name",
            "last_name"
        ])

        # submission 1
        spk_key = speaker.make_and_store_new_speaker("*****@*****.**")
        spk = spk_key.get()
        spk.set_first_name("Harry")
        spk.set_later_names("J Potter")
        spk.put()

        harry_talk = talk.Talk(parent=spk_key)
        harry_talk.title = "Harry talks"
        harry_talk.put()
        sub_key = submissionrecord.make_submission_plus(
            harry_talk.key, self.conf.key, None, None, None, None)

        # submission 2
        spk_key2 = speaker.make_and_store_new_speaker("*****@*****.**")
        spk2 = spk_key2.get()
        spk2.set_first_name("Hermione")
        spk2.set_later_names("Granger")
        spk2.put()

        hammy_talk = talk.Talk(parent=spk_key2)
        hammy_talk.title = "Hermione talks"
        hammy_talk.put()
        sub_key2 = submissionrecord.make_submission_plus(
            hammy_talk.key, self.conf.key, None, None, None, None)

        sub_report.export_submissions_to_excel([sub_key, sub_key2])
        self.assertEquals(18, mock_sheet_write.call_count)

        call_cnt = 0
        header_row = 0
        self.assertEquals((header_row, 0, "Agreed GDPR policy"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 1, "Communication"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 2, "Talk title"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 3, "Email"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 4, "First name"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 5, "Later names"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        data_row = 1
        self.assertEquals((data_row, 0, "False"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 1, submissionnotifynames.SUBMISSION_NEW),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 2, "Harry talks"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 3, "*****@*****.**"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 4, "Harry"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 5, "J Potter"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        data_row = 2
        self.assertEquals((data_row, 0, "False"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 1, submissionnotifynames.SUBMISSION_NEW),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 2, "Hermione talks"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 3, "*****@*****.**"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 4, "Hermione"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row, 5, "Granger"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
Esempio n. 12
0
    def test_excel_export_with_data(self, mock_storage_open, mock_sheet_write):
        sub_report_key = customexport.mk_report(self.conf.key,
                                                "AllTheFieldsReport")
        sub_report = sub_report_key.get()
        self.assertEquals([], sub_report.submission_options())

        sub_report.add_submission_options([
            "created", "grdp_agreed", "track", "duration", "decision1",
            "decision2", "format", "withdrawn", "speaker_comms", "expenses",
            "title", "short_synopsis", "long_synopsis", "email", "first_name",
            "last_name", "picture", "blog", "cospeakers", "address"
        ])

        # add some detail to conference to check mappings
        track_option = confoptions.make_conference_track(
            self.conf.key, "New Track")
        time_option = confoptions.make_conference_option(
            confoptions.DurationOption, self.conf.key, "30 minutes")
        format_option = confoptions.make_conference_option(
            confoptions.TalkFormatOption, self.conf.key, "Lecture")
        expenses_option = confoptions.make_conference_option(
            confoptions.ExpenseOptions, self.conf.key, "Longhaul")

        spk_key = speaker.make_and_store_new_speaker("*****@*****.**")
        spk = spk_key.get()
        spk.set_first_name("Harry")
        spk.set_later_names("J Potter")
        spk.set_field(speaker.Speaker.FIELD_BLOG, "www.myblog.com")
        zurich = "Z\xc3\xbcric"
        spk.set_field(speaker.Speaker.FIELD_ADDRESS, zurich)
        spk.put()

        t1 = talk.Talk(parent=spk_key)
        t1.title = "Talk T1"
        t1.set_field("shortsynopsis", "Very short synopsis")
        t1.set_field("longsynopsis",
                     "A much much longer synopsis that goes on and on")
        t1.put()
        sub = submissionrecord.make_submission_plus(
            t1.key, self.conf.key, track_option.shortname(),
            format_option.shortname(), time_option.shortname(),
            expenses_option.shortname()).get()
        sub.set_review_decision(1, "Shortlist")
        sub.set_review_decision(2, "Decline")

        cospeaker.make_cospeaker(sub.key, "Ron Weesley", "*****@*****.**")
        cospeaker.make_cospeaker(sub.key, "H Granger", "*****@*****.**")

        sub_report.export_submissions_to_excel([sub.key])
        self.assertEquals(40, mock_sheet_write.call_count)

        # test header row
        call_cnt = 0
        header_row = 0
        # cell A1 (1,1) contains "created"
        self.assertEquals((header_row, 0, "Date and time created"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        self.assertEquals((header_row, 1, "Agreed GDPR policy"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        self.assertEquals((header_row, 2, "Track"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 3, "Length"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 4, "Decision round 1"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 5, "Decision round 2"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 6, "Format"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 7, "Withdrawn"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 8, "Communication"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 9, "Expenses"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 10, "Talk title"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 11, "Short synopsis"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 12, "Long synopsis"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 13, "Email"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 14, "First name"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 15, "Later names"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 16, "Picture"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 17, "Blog"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 18, "Co-speakers"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((header_row, 19, "Address"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        # test data rows
        data_row1 = 1
        # worksheet entry for Created (cell 2,1) - excel is zero based so A1 is 0,0
        self.assertEquals((data_row1, 0),
                          mock_sheet_write.mock_calls[call_cnt][1][1:3])
        # datetime.now hasn't been stubbed so just test it is not empty
        self.assertIsNot(0, len(mock_sheet_write.mock_calls[call_cnt][1][3]))
        call_cnt += 1

        # worksheet entry for GDPR (cell 2,2)
        self.assertEquals((data_row1, 1, "False"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1

        self.assertEquals((data_row1, 2, "New Track"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 3, "30 minutes"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 4, "Shortlist"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 5, "Decline"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 6, "Lecture"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 7, "False"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 8, submissionnotifynames.SUBMISSION_NEW),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 9, "Longhaul"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 10, "Talk T1"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 11, "Very short synopsis"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals(
            (data_row1, 12, "A much much longer synopsis that goes on and on"),
            mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 13, "*****@*****.**"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 14, "Harry"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 15, "J Potter"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        # odd return on local but server address makes sense when live
        self.assertEquals(
            (data_row1, 16, "https:///sorry_page?reason=NoImage"),
            mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 17, "www.myblog.com"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((
            data_row1, 18,
            "Ron Weesley ([email protected]), H Granger ([email protected])"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
        self.assertEquals((data_row1, 19, "Z\xc3\xbcric"),
                          mock_sheet_write.mock_calls[call_cnt][1][1:])
        call_cnt += 1
Esempio n. 13
0
    def standard_test_data(self):
        conf_key = self.get_crrt_conference_key()
        conference = conf_key.get()
        track1 = confoptions.make_conference_track(conf_key,
                                                   "Software delivery")
        track2 = confoptions.make_conference_track(conf_key,
                                                   "Product Management")
        track3 = confoptions.make_conference_track(conf_key, "Team working")
        duration1 = confoptions.make_conference_option(
            confoptions.DurationOption, conf_key,
            "Single session (45 minutes)")
        confoptions.make_conference_option(confoptions.DurationOption,
                                           conf_key,
                                           "Double session (90 minutes+)")

        format1 = confoptions.make_conference_option(
            confoptions.TalkFormatOption, conf_key, "Lecture style")
        confoptions.make_conference_option(
            confoptions.TalkFormatOption, conf_key,
            "Interactive with exercises (no computers)")

        expenses1 = confoptions.make_conference_option(
            confoptions.ExpenseOptions, conf_key, "Local")
        confoptions.make_conference_option(confoptions.ExpenseOptions,
                                           conf_key, "UK")

        s = speaker.make_new_speaker("*****@*****.**")
        s.name = "Speaker Test"
        speaker_key = s.put()

        t = talk.Talk(parent=s.key)
        t.title = "All talk"
        t_key = t.put()

        sub_key = submissionrecord.make_submission_plus(
            t_key, conf_key, track1.shortname(), format1.shortname(),
            duration1.shortname(), expenses1.shortname())

        t2 = talk.Talk(parent=s.key)
        t2.title = "Talk2"
        t2_key = t.put()

        sub_key2 = submissionrecord.make_submission_plus(
            t2_key, conf_key, track1.shortname(), format1.shortname(),
            duration1.shortname(), expenses1.shortname())

        conference.user_rights().add_permission("*****@*****.**",
                                                userrightsnames.CONF_CREATOR)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.CHANGE_CONF_STATE)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.APPOINT_REVIEWERS)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.ROUND1_REVIEWER)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.ROUND1_DECISION)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.ROUND2_REVIEWER)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.ROUND2_DECISION)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.ROUND2_DECISION)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.SPEAK_COMMS_COMMS)
        conference.user_rights().add_permission(
            "*****@*****.**", userrightsnames.CONF_DATA_DUMPS)

        conference.user_rights().add_track_reviewer("*****@*****.**",
                                                    track1.shortname())
        conference.user_rights().add_track_reviewer("*****@*****.**",
                                                    track2.shortname())
        conference.user_rights().add_track_reviewer("*****@*****.**",
                                                    track3.shortname())

        reportrecord.mk_report_record(conf_key, "Export", "none.such")

        return '/confoptionspage?conf=' + conf_key.urlsafe()