pjoshi has proposed merging lp:~prakhar126/postorius/adding_dropdown_option 
into lp:postorius.

Requested reviews:
  Mailman Coders (mailman-coders)
Related bugs:
  Bug #1157875 in Postorius: "Pipeline list setting should probably be a 
dropdown rather than text field"
  https://bugs.launchpad.net/postorius/+bug/1157875

For more details, see:
https://code.launchpad.net/~prakhar126/postorius/adding_dropdown_option/+merge/252878
-- 
Your team Mailman Coders is requested to review the proposed merge of 
lp:~prakhar126/postorius/adding_dropdown_option into lp:postorius.
=== modified file 'src/postorius/forms.py'
--- src/postorius/forms.py	2015-02-09 14:35:44 +0000
+++ src/postorius/forms.py	2015-03-13 10:43:56 +0000
@@ -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'),

=== modified file 'src/postorius/tests/test_forms.py'
--- src/postorius/tests/test_forms.py	2015-02-09 14:35:44 +0000
+++ src/postorius/tests/test_forms.py	2015-03-13 10:43:56 +0000
@@ -49,3 +49,26 @@
             'contact_address': '[email protected]',
         })
         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': '[email protected]'
+            '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

_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to