From 3b2d4697806d441ac69b789f004bea8171f5aa41 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 25 Jul 2020 21:37:15 +0200 Subject: [PATCH] e2e: ensure that PasswordStage's change_flow is set correctly --- e2e/test_flows_stage_setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/e2e/test_flows_stage_setup.py b/e2e/test_flows_stage_setup.py index 14b2e2576..8145ecaf2 100644 --- a/e2e/test_flows_stage_setup.py +++ b/e2e/test_flows_stage_setup.py @@ -8,6 +8,8 @@ from selenium.webdriver.common.keys import Keys from e2e.utils import USER, SeleniumTestCase from passbook.core.models import User +from passbook.flows.models import Flow, FlowDesignation +from passbook.stages.password.models import PasswordStage class TestFlowsStageSetup(SeleniumTestCase): @@ -15,6 +17,16 @@ class TestFlowsStageSetup(SeleniumTestCase): def test_password_change(self): """test password change flow""" + # Ensure that password stage has change_flow set + flow = Flow.objects.get( + slug="default-password-change", designation=FlowDesignation.STAGE_SETUP, + ) + + stages = PasswordStage.objects.filter(name="default-authentication-password") + stage = stages.first() + stage.change_flow = flow + stage.save() + new_password = "".join( SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(8)