Skip to content

Instantly share code, notes, and snippets.



Created Dec 10, 2014
What would you like to do?
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
qp = flow.process_cls.objects.get()
assert qp
assert qp.organization == org
# Approve a quality request
[approve] = qp.active_tasks(), 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()
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
You can’t perform that action at this time.