mock.py 文件源码

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

项目:intake 作者: codeforamerica 项目源码 文件源码
def make_mock_transfer_sub(from_org, to_org):
    sub = factories.FormSubmissionWithOrgsFactory.create(
        organizations=[from_org])
    application = sub.applications.first()
    author = from_org.profiles.first().user
    # make a status_update prior to transfer
    factories.StatusUpdateWithNotificationFactory.create(
        application=application, author=author)
    transfer, *stuff = services.transfers_service.transfer_application(
        author=author, application=application,
        to_organization=to_org, reason="Transporter malfunction")
    message = 'Your case has been transferred to {}.\n{}'.format(
        to_org.name, to_org.short_confirmation_message)
    factories.StatusNotificationFactory.create(
        status_update=transfer.status_update, base_message=message,
        sent_message=message)
    return sub
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号