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

Proposed by pjoshi
Status: Needs review
Proposed branch: lp:~prakhar126/postorius/postorius
Merge into: lp:postorius
Diff against target: 44 lines (+26/-1)
2 files modified
src/postorius/templates/postorius/user_tasks.html (+3/-1)
src/postorius/tests/test_forms.py (+23/-0)
To merge this branch: bzr merge lp:~prakhar126/postorius/postorius
Reviewer Review Type Date Requested Status
Terri Needs Fixing
Review via email: mp+252422@code.launchpad.net

Description of the change

Adding test cases for creating new list.

To post a comment you must log in.
Revision history for this message
Terri (terriko) wrote :

I'm getting the following error:

  File "/Users/terri/Code/mailman/postorius/src/postorius/tests/test_forms.py", line 58
    'mail_host': 'mailman.most-desirable.org'
               ^
SyntaxError: invalid syntax

If you could tidy that up, that would be great!

review: Needs Fixing

Unmerged revisions

204. By pjoshi

adding test case for new list form

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/postorius/templates/postorius/user_tasks.html'
2--- src/postorius/templates/postorius/user_tasks.html 2014-10-15 20:59:52 +0000
3+++ src/postorius/templates/postorius/user_tasks.html 2015-03-10 12:00:51 +0000
4@@ -4,5 +4,7 @@
5
6 {% block main %}
7 <h1>{% trans "To Do" %}</h1>
8- <p>{% trans "There are no pending tasks at the present time." %}</p>
9+ {% for tasks in memberships %}
10+ <p> {% trans tasks %}</p>
11+ {% endfor %}
12 {% endblock main %}
13
14=== modified file 'src/postorius/tests/test_forms.py'
15--- src/postorius/tests/test_forms.py 2015-02-09 14:35:44 +0000
16+++ src/postorius/tests/test_forms.py 2015-03-10 12:00:51 +0000
17@@ -49,3 +49,26 @@
18 'contact_address': 'contact@mailman.most-desirable.org',
19 })
20 self.assertFalse(form.is_valid())
21+
22+class ListNewTest(unittest.TestCase):
23+
24+ def test_form_fields_list(self):
25+ form = ListNew({
26+ 'listname': 'xyz'
27+ 'mail_host': 'mailman.most-desirable.org'
28+ 'list_owner': 'contact@mailman.most-desirable.org'
29+ 'advertise': 'abcd'
30+ 'description': 'The Most Desirable organization'
31+ })
32+ self.assertTrue(form.is_valid)
33+
34+ def test_form_fields_list_invalid(self):
35+ form = ListNew({
36+ 'listname': ''xy#z'
37+ 'mail_host': 'mailman.most-desirable.org'
38+ 'list_owner': 'mailman.most-desirable.org'
39+ 'advertise': 'abcd'
40+ 'description': 'The Most Desirable organization'
41+ })
42+ self.assertFalse(form.is_valid)
43+
44\ No newline at end of file

Subscribers

People subscribed via source and target branches