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')
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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