test_submission_wizard.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:pretalx 作者: pretalx 项目源码 文件源码
def test_wizard_logged_in_user_no_questions(self, event, client, user):
        submission_type = SubmissionType.objects.filter(event=event).first().pk

        client.force_login(user)
        response, current_url = self.perform_init_wizard(client)
        response, current_url = self.perform_info_wizard(client, response, current_url, submission_type=submission_type, next='profile')
        response, current_url = self.perform_profile_form(client, response, current_url)

        doc = bs4.BeautifulSoup(response.rendered_content, "lxml")
        assert doc.select('.alert-success')
        assert doc.select('.user-row')
        sub = Submission.objects.last()
        assert sub.title == 'Submission title'
        assert not sub.answers.exists()
        s_user = sub.speakers.first()
        assert s_user.pk == user.pk
        assert s_user.nick == 'testuser'
        assert s_user.name == 'Jane Doe'
        assert s_user.profiles.get(event=event).biography == 'l337 hax0r'
        assert len(djmail.outbox) == 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号