def test_words(self): rng = mock.Mock() rng.choice = mock.Mock(side_effect=non_random_choice) s = Words.sentence(rng) self.assertEquals( s, 'accepting a aboard abandoned aardvark', 'sentence built from the first word of each list respectively')
def create_talk(self, speaker): talk = Talk(speaker=speaker, title=Words.sentence(self.rng).title(), abstract=lorem.paragraph(), remarks=lorem.paragraph()) talk.save() return talk
def create_talk(self, speaker, formats): talk = Talk(speaker=speaker, title=Words.sentence(self.rng).title(), abstract=lorem.paragraph(), remarks=lorem.paragraph()) talk.save() talk.talkformat.add( *self.rng.sample(formats, self.rng.randint(1, len(formats)))) return talk
def create_talk(self, speaker, formats, event): talk = Talk.objects.create( draft_speaker=speaker, title=Words.sentence(self.rng).title(), abstract=lorem.paragraph(), remarks=lorem.paragraph(), event=event, ) talk.talkformat.add( *self.rng.sample(formats, self.rng.randint(1, len(formats)))) return talk