Merge lp:~prakhar126/postorius/adding_dropdown_option into lp:postorius

Proposed by pjoshi
Status: Merged
Merged at revision: 234
Proposed branch: lp:~prakhar126/postorius/adding_dropdown_option
Merge into: lp:postorius
Diff against target: 56 lines (+33/-1)
2 files modified
src/postorius/forms.py (+10/-1)
src/postorius/tests/test_forms.py (+23/-0)
To merge this branch: bzr merge lp:~prakhar126/postorius/adding_dropdown_option
Reviewer Review Type Date Requested Status
Terri Needs Fixing
Review via email: mp+252878@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Terri (terriko) wrote :

I'm finding some errors in the tests here (missing commas, for example). I'll see if they're things I can fix relatively quickly.

review: Needs Fixing
Revision history for this message
Terri (terriko) wrote :

Here's the fixed code. There were a lot of syntax errors here. In future, please actually run the tests before you submit a merge proposal!

class ListNewTest(unittest.TestCase):

    def test_form_fields_list(self):
        form = ListNew({
            'listname': 'xyz',
            'mail_host': 'mailman.most-desirable.org',
            'list_owner': '<email address hidden>',
            '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())

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
426 # label=_('No reply address'),426 # label=_('No reply address'),
427 # required=False,427 # required=False,
428 # )428 # )
429 posting_pipeline = forms.CharField(429 posting_pipeline = forms.ChoiceField(
430 label=_('Pipeline'),430 label=_('Pipeline'),
431 widget=forms.Select(),
432 required=False,
433 error_messages={
434 'required': _("Please choose a reply-to action.")},
435 choices=(
436 ("default-owner-pipeline", _("default-owner-pipeline")),
437 ("default-posting-pipeline", _("default-posting-pipeline")),
438 ("virgin", _("virgin"))),
431 help_text=(439 help_text=(
432 'Type of pipeline you want to use for this mailing list')440 'Type of pipeline you want to use for this mailing list')
441
433 )442 )
434 # post_id = forms.IntegerField(443 # post_id = forms.IntegerField(
435 # label=_('Post ID'),444 # label=_('Post ID'),
436445
=== 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 @@
49 'contact_address': 'contact@mailman.most-desirable.org',49 'contact_address': 'contact@mailman.most-desirable.org',
50 })50 })
51 self.assertFalse(form.is_valid())51 self.assertFalse(form.is_valid())
52
53class ListNewTest(unittest.TestCase):
54
55 def test_form_fields_list(self):
56 form = ListNew({
57 'listname': 'xyz'
58 'mail_host': 'mailman.most-desirable.org'
59 'list_owner': 'contact@mailman.most-desirable.org'
60 'advertise': 'abcd'
61 'description': 'The Most Desirable organization'
62 })
63 self.assertTrue(form.is_valid)
64
65 def test_form_fields_list_invalid(self):
66 form = ListNew({
67 'listname': ''xy#z'
68 'mail_host': 'mailman.most-desirable.org'
69 'list_owner': 'mailman.most-desirable.org'
70 'advertise': 'abcd'
71 'description': 'The Most Desirable organization'
72 })
73 self.assertFalse(form.is_valid)
74
52\ No newline at end of file75\ No newline at end of file

Subscribers

People subscribed via source and target branches