Exemple #1
0
    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())
Exemple #2
0
    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())
Exemple #3
0
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
Exemple #4
0
    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())
Exemple #5
0
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"
Exemple #6
0
 def setUp(self):
     self.speaker = SpeakerFactory()
     meetup = MeetupFactory(date=datetime(2000, 1, 1))
     talk = TalkFactory()
     self.speaker.talks.add(talk)
     meetup.talks.add(talk)