diff --git a/tests/test_to_check.txt b/tests/test_to_check.txt index 07e63f0..4a5654d 100644 --- a/tests/test_to_check.txt +++ b/tests/test_to_check.txt @@ -1,6 +1,3 @@ - -## was success until here (old template) - Change the User Settings ======================== @@ -34,28 +31,8 @@ >>> print "The user settings have been updated." in response.content True -Change the Memebership Settings -=============================== -Now let's go to the membership settings page. Once we go there we -should get a list of all the available lists. - - >>> response = c.get('/membership_settings/katie%40example.com/') - -Check that we came to the right place... - - >>> print "Membership Settings" in response.content - True - -...and select the list 'test-one@example.com'. - - >>> response = c.get('/membership_settings/katie%40example.com/?list=test-one@example.com') - -Lets make sure we got to the right page. - - >>> print "Membership Settings for test-one@example.com" in response.content - True - +#MEMBERSHIP SETTINGS part2 #TODO We want to make sure we don't hide our address when posting to the list, so we change this option and save the form. @@ -79,62 +56,6 @@ >>> print "All mailing lists" in response.content True -View the List Info Page -======================= - -Apart from just viewing a list of all the available lists we can -view the information about one particular list on a list info page. -On this page we can also subscribe or unsubscribe an email address -to the list. Let's try to subscribe to the list in the "normal" way -(i.e. not using mass subscription). First we go to the page. - - >>> response = c.get('/lists/new_list1%40mail.example.com/',) - -Then we check that everything went well. - - >>> response.status_code - 200 - -Subscribe a User -================ - -And finally we try to subscribe a user named 'Meg'. - - >>> response = c.post('/lists/new_list1%40mail.example.com/', - ... {"email": "meg@example.com", - ... "real_name": "Meg", - ... "name": "subscribe", - ... "listname": "new_list@example.com"}) - -This page contains a redirect so we check the status code for this. - - >>> response.status_code - 302 - -Then we check that the redirect gives the correct status code. - - >>> response = c.get("http://testserver/lists/") - - >>> response.status_code - 200 - -Unsubscribe a User -================== - -We'll now try unsubscribing the address for Meg. - - >>> response = c.post('/lists/new_list1%40mail.example.com/', - ... {"email": "meg@example.com", - ... "real_name": "Meg", - ... "name": "unsubscribe", - ... "listname": "new_list@example.com"}) - -If everything went well, we'll get a positive response saying so. - - >>> print "You have now been unsubscribed from new_list@example.com." in \ - response.content - True - Delete the List =============== diff --git a/tests/tests.py b/tests/tests.py index ff58e7e..2362ec1 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -270,6 +270,28 @@ >>> print _("The mass subscription was successful.") in response.content True +Change the Memebership Settings +=============================== + +Now let's go to the membership settings page. Once we go there we +should get a list of all the available lists. + + >>> response = c.get('/membership_settings/new_list1%40mail.example.com/') + +Check that we came to the right place... + + >>> print "Membership Settings" in response.content + True + +...and select the list 'test-one@example.com'. + + >>> response = c.get('/membership_settings/new_list1%40mail.example.com/') + +Lets make sure we got to the right page. + + >>> print ("Membership Settings" in response.content) and ("for new_list1@mail.example.com" in response.content) + True + Finishing Test =============== diff --git a/views.py b/views.py index 499a54c..9bd809e 100644 --- a/views.py +++ b/views.py @@ -410,10 +410,11 @@ change to the correct calls here """ member = request.user.username - message = "" + message = '' form = None the_list=None membership_lists = [] + try: c = Client('http://localhost:8001/3.0', API_USER, API_PASS) if tab == "membership": @@ -433,6 +434,7 @@ else: # address_choices for the 'address' field must be a list of # tuples of length 2 + raise Exception("WORK in PROGRRESS needs REST Auth Middleware! - TODO") address_choices = [[addr, addr] for addr in user_object.address] except AttributeError, e: return render_to_response('mailman-django/errors/generic.html',