def handle(self, *args, **options): for i in range(10): meetup = MeetupFactory.create() talk = TalkFactory.create(meetup=meetup) talk.speakers.add(SpeakerFactory.create()) talk = TalkFactory.create(meetup=meetup) talk.speakers.add(SpeakerFactory.create())
def handle(self, *args, **options): meetup_type = MeetupTypeFactory.create() for i in range(10): meetup = MeetupFactory.create(meetup_type=meetup_type) talk = TalkFactory.create(meetup=meetup) talk.speakers.add(SpeakerFactory.create()) talk = TalkFactory.create(meetup=meetup) talk.speakers.add(SpeakerFactory.create()) meetup.sponsors.add(SponsorFactory()) meetup.sponsors.add(SponsorFactory())
def test_if_proposal_is_included_on_the_talk_admin_page(admin_client, db): talk_proposal = TalkProposalFactory(talk=TalkFactory()) response = admin_client.get( f'/admin/meetups/talk/{talk_proposal.id}/change/') content = response.content.decode("utf-8") assert response.status_code == 200 assert str(talk_proposal.date_submitted) in content assert talk_proposal.message in content
def test_accepts_when_existing_speaker_is_set_and_new_speaker_fields_are_not(self): speaker = SpeakerFactory() meetup = MeetupFactory(date=datetime(2000, 1, 1)) talk = TalkFactory() speaker.talks.add(talk) meetup.talks.add(talk) form = forms.TalkProposalForm(data={ 'talk_title': 'title', 'talk_description': 'description', 'speaker': speaker.id, }) self.assertTrue(form.is_valid())
def test_str(talk_factory: factories.TalkFactory) -> None: """Test that the string representation returns the name.""" talk = talk_factory.build(name="Python", slug="python", description="Best talk ever.") assert str(talk) == "Python"
def setUp(self): self.speaker = SpeakerFactory() meetup = MeetupFactory(date=datetime(2000, 1, 1)) talk = TalkFactory() self.speaker.talks.add(talk) meetup.talks.add(talk)