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)
def default_data(self): conf_key = self.get_crrt_conference_key() conference = conf_key.get() track1 = confoptions.make_conference_track(conf_key, "Technical") track2 = confoptions.make_conference_track(conf_key, "Management") track3 = confoptions.make_conference_track(conf_key, "Teams") 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 (no computers)") expenses1 = confoptions.make_conference_option( confoptions.ExpenseOptions, conf_key, "Long-haul") confoptions.make_conference_option(confoptions.ExpenseOptions, conf_key, "Short-haul") return '/confoptionspage?conf=' + conf_key.urlsafe()
def test_new_track(self): c = conference.Conference() c.name = "TestConf" c.put() self.assertEquals(c.track_options(), {}) self.assertEquals(c.track_objects(), []) to = confoptions.make_conference_track(c.key, "New Track") self.assertEquals(to.shortname(), "Option1") self.assertEquals(to.full_text(), "New Track") self.assertEquals(3, to.slots) self.assertEquals(c.track_options(), {"Option1": "New Track"}) tracks = c.track_objects() self.assertEquals(len(tracks), 1) self.assertIsInstance(tracks[0], confoptions.TrackOption) self.assertEquals(tracks[0].shortname(), "Option1") self.assertEquals(tracks[0].full_text(), "New Track") confoptions.make_conference_track(c.key, "Another track") self.assertEquals(c.track_options(), {"Option1": "New Track", "Option2": "Another track"}) tracks = c.track_objects() self.assertEquals(len(tracks), 2) self.assertIsInstance(tracks[1], confoptions.TrackOption) self.assertEquals(tracks[0].shortname(), "Option1") self.assertEquals(tracks[0].full_text(), "New Track") self.assertEquals(tracks[1].shortname(), "Option2") self.assertEquals(tracks[1].full_text(), "Another track")
def mk_test_data(self, name): new_conf = conference.Conference() new_conf.name = name new_conf.put() subm_key = submissionrecord.make_submission(None, new_conf.key, "Track", "Format") confoptions.make_conference_track(new_conf.key, "Track") voterecord.cast_new_vote(subm_key, "Harry", 2, "No comment", 1) cospeaker.make_cospeaker(subm_key, "Ron", "ron2hogwarts.com") return new_conf.key, subm_key
def test_tracks_list_and_string(self): c = conference.Conference() c.name = "TestConf" c.put() self.assertEquals(c.track_names([]), []) self.assertEquals(c.tracks_string([]), "") opt1 = confoptions.make_conference_track(c.key, "Track 1") self.assertEquals(c.track_names([opt1.shortname()]), ["Track 1"]) self.assertEquals(c.tracks_string([opt1.shortname()]), "Track 1") opt2 = confoptions.make_conference_track(c.key, "Track 2") self.assertEquals(c.track_names([opt1.shortname(), opt2.shortname()]), ["Track 1", "Track 2"]) self.assertEquals(c.tracks_string( [opt1.shortname(), opt2.shortname()]), "Track 1, Track 2")
def test_track_assignments(self): factory = confreviewconfig.get_conference_review_factory(self.conference.key) factory.set_round(1, confreviewconfig.NewScoringReview) self.assertEquals("New scoring", factory.get_round_config(round=1).name()) newscore_config = factory.get_round_config(1) self.assertEquals({}, newscore_config.track_limits()) track1 = confoptions.make_conference_track(self.conference.key, "Track1") self.assertEquals({track1.shortname(): 10}, newscore_config.track_limits()) track2 = confoptions.make_conference_track(self.conference.key, "Track2") self.assertItemsEqual({track1.shortname(): 10, track2.shortname(): 10}, newscore_config.track_limits()) newscore_config.set_track_limit(track1.shortname(), 20) self.assertItemsEqual({track1.shortname(): 20, track2.shortname(): 10}, newscore_config.track_limits())
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)
def test_tracks_with_slots(self): c = conference.Conference() c.name = "TestConf" c.put() confoptions.make_conference_track(c.key, "New Track") confoptions.make_conference_track(c.key, "Another track") tracks = c.track_objects() some_track = tracks[1] some_track.slots = 4 some_track.put() tracks = c.mapped_track_obects() self.assertEquals(len(tracks), 2) self.assertEquals(tracks["Option1"].shortname(), "Option1") self.assertEquals(tracks["Option1"].full_text(), "New Track") self.assertEquals(tracks["Option1"].slots, 3) self.assertEquals(tracks["Option2"].shortname(), "Option2") self.assertEquals(tracks["Option2"].full_text(), "Another track") self.assertEquals(tracks["Option2"].slots, 4)
def test_delete_option(self): c = conference.Conference() c.name = "TestConf" c.put() self.assertEquals(c.track_options(), {}) self.assertEquals(c.track_objects(), []) confoptions.make_conference_track(c.key, "New Track") self.assertEquals(len(c.track_objects()), 1) confoptions.make_conference_track(c.key, "Another Track") self.assertEquals(len(c.track_objects()), 2) tracks = c.track_options() self.assertEquals(len(tracks), 2) delete_track = tracks.keys()[0] keep_track = tracks.keys()[1] confoptions.delete_option(confoptions.TrackOption, c.key, delete_track) self.assertEquals(len(c.track_objects()), 1) remaining_tracks = c.track_options() self.assertEquals(remaining_tracks.keys()[0], keep_track)
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
def test_delete_conference(self): c = conference.Conference() c.name = "TestConf" c.put() ur = userrights.UserRights(c.key) ur.add_track_reviewer("harry", "technology track") self.assertEquals( 1, self.count_db_entries(userrights.RightsRecord, c.key)) track1 = confoptions.make_conference_track(c.key, "New Track") track2 = confoptions.make_conference_track(c.key, "Another track") self.assertEquals( 2, self.count_db_entries(confoptions.TrackOption, c.key)) duration1 = confoptions.make_conference_option( confoptions.DurationOption, c.key, "30 minutes") self.assertEquals( 1, self.count_db_entries(confoptions.DurationOption, c.key)) confoptions.make_conference_option(confoptions.TalkFormatOption, c.key, "Lecture") self.assertEquals( 1, self.count_db_entries(confoptions.TalkFormatOption, c.key)) confoptions.make_conference_option(confoptions.ExpenseOptions, c.key, "Local") self.assertEquals( 1, self.count_db_entries(confoptions.ExpenseOptions, c.key)) review_config = confreviewconfig.get_conference_review_factory(c.key) self.assertIsNotNone(review_config) self.assertEquals( 1, self.count_db_entries(confreviewconfig.ConferenceReviewFactory, c.key)) self.assertEquals( 0, self.count_db_entries(confreviewconfig.ClassicReview, c.key)) self.assertEquals( 1, self.count_db_entries(confreviewconfig.NewScoringReview, c.key)) self.assertEquals( 1, self.count_db_entries(confreviewconfig.RankReview, c.key)) s = speaker.make_new_speaker("mail@email") s.name = "Arnold Rimmer" s.put() t = talk.Talk(parent=s.key) t.title = "A testing talk" t.put() sub_key = submissionrecord.make_submission(t.key, c.key, "track", "format") self.assertEquals( 1, self.count_db_entries(submissionrecord.SubmissionRecord, c.key)) vote = voterecord.cast_new_vote(sub_key, "Reviewer1", 2, "No comment", 1) self.assertEquals(1, self.count_db_entries(voterecord.VoteRecord, c.key)) rev = reviewer.make_new_reviewer(c.key, "rimmer@email") self.assertEquals(1, self.count_db_entries(reviewer.Reviewer, c.key)) rev.assign_submission("track", [sub_key], review_round=1) self.assertEquals( 1, self.count_db_entries(reviewer.ReviewAssignment, c.key)) confdelete.cascade_delete_conference(c.key) self.assertEquals( 0, self.count_db_entries(userrights.RightsRecord, c.key)) self.assertEquals( 0, self.count_db_entries(submissionrecord.SubmissionRecord, c.key)) self.assertEquals(0, self.count_db_entries(voterecord.VoteRecord, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.TrackOption, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.DurationOption, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.TalkFormatOption, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.ExpenseOptions, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.AcknowledgementEmailCCAddresses, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.AcknowledgementEmailBCCAddresses, c.key)) self.assertEquals( 0, self.count_db_entries(confoptions.AcceptEmailCCAddress, c.key)) self.assertEquals( 0, self.count_db_entries(confreviewconfig.ConferenceReviewFactory, c.key)) self.assertEquals( 0, self.count_db_entries(confreviewconfig.ClassicReview, c.key)) self.assertEquals( 0, self.count_db_entries(confreviewconfig.NewScoringReview, c.key)) self.assertEquals( 0, self.count_db_entries(confreviewconfig.RankReview, c.key)) self.assertEquals( 0, self.count_db_entries(dedupvotes.DuplicateVoteReport, c.key)) self.assertEquals( 0, self.count_db_entries(reviewer.ReviewAssignment, c.key)) self.assertEquals(0, self.count_db_entries(reviewer.Reviewer, c.key))
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
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()
def test_aotb_cutover(self): c = conference.Conference() c.name = "TestConf" c.put() confoptions.make_conference_track(c.key, "Software delivery") opt = confoptions.make_conference_track(c.key, "Delete me") confoptions.make_conference_track(c.key, "Product Design") confoptions.make_conference_track(c.key, "Product Management") confoptions.make_conference_track(c.key, "Team working") confoptions.make_conference_track(c.key, "Agile Practices") confoptions.make_conference_track(c.key, "Agility in businesss") # this will cause option2 to be missing opt.key.delete() # Need to sort so equality can be applied self.assertEquals(sorted(c.track_options().values()), sorted(c.track_options().values())) self.assertEquals( sorted(c.track_options().keys()), sorted([ "Option1", "Option3", "Option4", "Option5", "Option6", "Option7" ]))