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
评论列表
文章目录