diff --git a/src/postorius/forms.py b/src/postorius/forms.py index 13bad30..8376691 100644 --- a/src/postorius/forms.py +++ b/src/postorius/forms.py @@ -426,10 +426,19 @@ # label=_('No reply address'), # required=False, # ) - posting_pipeline = forms.CharField( + posting_pipeline = forms.ChoiceField( label=_('Pipeline'), + widget=forms.Select(), + required=False, + error_messages={ + 'required': _("Please choose a reply-to action.")}, + choices=( + ("default-owner-pipeline", _("default-owner-pipeline")), + ("default-posting-pipeline", _("default-posting-pipeline")), + ("virgin", _("virgin"))), help_text=( 'Type of pipeline you want to use for this mailing list') + ) # post_id = forms.IntegerField( # label=_('Post ID'), diff --git a/src/postorius/tests/test_forms.py b/src/postorius/tests/test_forms.py index a48c8f5..ca27256 100644 --- a/src/postorius/tests/test_forms.py +++ b/src/postorius/tests/test_forms.py @@ -49,3 +49,26 @@ 'contact_address': 'contact@mailman.most-desirable.org', }) self.assertFalse(form.is_valid()) + +class ListNewTest(unittest.TestCase): + + def test_form_fields_list(self): + form = ListNew({ + 'listname': 'xyz' + 'mail_host': 'mailman.most-desirable.org' + 'list_owner': 'contact@mailman.most-desirable.org' + 'advertise': 'abcd' + 'description': 'The Most Desirable organization' + }) + self.assertTrue(form.is_valid) + + def test_form_fields_list_invalid(self): + form = ListNew({ + 'listname': ''xy#z' + 'mail_host': 'mailman.most-desirable.org' + 'list_owner': 'mailman.most-desirable.org' + 'advertise': 'abcd' + 'description': 'The Most Desirable organization' + }) + self.assertFalse(form.is_valid) + \ No newline at end of file