Created
December 10, 2014 11:04
-
-
Save klen/2693899f5e7f375620e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
pytestmark = pytest.mark.django_db | |
def test_quality_flow(mixer, personal): | |
from core.flows import QualityFlow as flow | |
org = mixer.blend('core.organization', role='supplier') | |
# Attach an organization to flow | |
flow.start.run(org) | |
qp = flow.process_cls.objects.get() | |
assert qp | |
assert qp.organization == org | |
# Approve a quality request | |
[approve] = qp.active_tasks() | |
approve.flow_task.run(qp, reviewer=personal, level=2, approve=True) | |
qp = flow.process_cls.objects.get() | |
assert qp.approved | |
assert qp.level == 2 | |
assert qp.reviewed_by == personal | |
# Send message to owner | |
[send_approved] = qp.active_tasks() | |
send_approved.flow_task.run(qp) | |
qp = flow.process_cls.objects.get() | |
assert qp.status == 'DONE' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment