diff --git a/tests/test_workflow_import.py b/tests/test_workflow_import.py index 27374fee2..f1a09f31a 100644 --- a/tests/test_workflow_import.py +++ b/tests/test_workflow_import.py @@ -381,6 +381,10 @@ def test_commentable_action(pub): wf2 = Workflow.import_from_xml_tree(ET.parse(BytesIO(xml_export))) assert wf2.possible_status[0].items[0].required is False + commentable.button_label = 'button label' + wf2 = assert_import_export_works(wf) + assert wf2.possible_status[0].items[0].button_label == 'button label' + def test_variables_formdef(pub): wf = Workflow(name='variables') diff --git a/wcs/workflows.py b/wcs/workflows.py index 4cee17d62..ad537a2e7 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -2293,12 +2293,7 @@ class CommentableWorkflowStatusItem(WorkflowStatusItem): el = ET.SubElement(xml_item, 'button_label') else: el = ET.SubElement(xml_item, 'button_label') - if type(self.button_label) is unicode: - el.text = self.button_label - elif type(self.button_label) is str: - el.text = force_text(self.button_label, charset, errors='replace') - else: - raise AssertionError('unknown type for button_label (%r)' % self.button_label) + el.text = self.button_label def button_label_init_with_xml(self, element, charset, include_id=False): if element is None: