summaryrefslogtreecommitdiff
path: root/src/mailman/workflows/tests/test_workflow.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mailman/workflows/tests/test_workflow.py (renamed from src/mailman/app/tests/test_workflow.py)14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mailman/app/tests/test_workflow.py b/src/mailman/workflows/tests/test_workflow.py
index e82001540..3e7856b29 100644
--- a/src/mailman/app/tests/test_workflow.py
+++ b/src/mailman/workflows/tests/test_workflow.py
@@ -20,15 +20,15 @@
import json
import unittest
-from mailman.app.workflow import Workflow
-from mailman.interfaces.workflow import IWorkflowStateManager
+from mailman.interfaces.workflows import IWorkflowStateManager
from mailman.testing.layers import ConfigLayer
+from mailman.workflows.base import Workflow
from zope.component import getUtility
class MyWorkflow(Workflow):
- INITIAL_STATE = 'first'
- SAVE_ATTRIBUTES = ('ant', 'bee', 'cat')
+ initial_state = 'first'
+ save_attributes = ('ant', 'bee', 'cat')
def __init__(self):
super().__init__()
@@ -51,7 +51,7 @@ class MyWorkflow(Workflow):
class DependentWorkflow(MyWorkflow):
- SAVE_ATTRIBUTES = ('ant', 'bee', 'cat', 'elf')
+ save_attributes = ('ant', 'bee', 'cat', 'elf')
def __init__(self):
super().__init__()
@@ -136,7 +136,7 @@ class TestWorkflow(unittest.TestCase):
def test_save_and_restore_dependant_attributes(self):
# Attributes must be restored in the order they are declared in
- # SAVE_ATTRIBUTES.
+ # save_attributes.
workflow = iter(DependentWorkflow())
workflow.elf = 6
workflow.save()
@@ -153,7 +153,7 @@ class TestWorkflow(unittest.TestCase):
# Save the state of an old version of the workflow that would not have
# the cat attribute.
state_manager.save(
- self._workflow.token, 'first',
+ self._workflow.token, '["first"]',
json.dumps({'ant': 1, 'bee': 2}))
# Restore in the current version that needs the cat attribute.
new_workflow = MyWorkflow()