diff --git a/tests/test_to_check.txt b/tests/test_to_check.txt index caee23b..07e63f0 100644 --- a/tests/test_to_check.txt +++ b/tests/test_to_check.txt @@ -1,3 +1,4 @@ + ## was success until here (old template) Change the User Settings diff --git a/tests/tests.py b/tests/tests.py index 465aade..ff58e7e 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -60,7 +60,7 @@ >>> response = c.get('/domains/') -Check that Http Redirect is returned +Check that Http Redirect to the login is returned #TODO check url >>> from django.http import HttpResponseRedirect >>> print type(response) == HttpResponseRedirect @@ -71,7 +71,7 @@ For authentification we do need to setup a test user into the system. This including the login will be checked here: - >>> #c.... adduser() #TODO + >>> #c.... adduser() #TODO add user Check our own login form, which should redirect the user to a usable page after every successful login Login was successful if we get a return object to either the list index or a specified url @@ -90,8 +90,11 @@ Check the content to see that we came to the create page after logging in. - >>> response = c.post('/domains/') - + >>> response = c.get('/domains/') + +Then we check that everything went well. + >>> response.status_code + 200 >>> print "Domain Index" in response.content #TODO - change heading True @@ -100,7 +103,12 @@ True Now go to the Domains creation page - >>> response = c.post('/domains/new/') + >>> response = c.get('/domains/new/') + +Then we check that everything went well. + + >>> response.status_code + 200 >>> print "Add a new Domain" in response.content #TODO - change heading True @@ -111,7 +119,11 @@ ... {"mail_host": "mail.example.com", ... "web_host": "example.com", ... "description": "doctest testing domain"}) - >>> response = c.post('/domains/') + >>> response = c.get('/domains/') + +Then we check that everything went well. + >>> response.status_code + 200 >>> print "doctest testing domain" in response.content True @@ -120,6 +132,11 @@ Try to access the list index >>> response = c.get('/lists/') + +Then we check that everything went well. + >>> response.status_code + 200 + >>> "All available Lists" in response.content True @@ -128,9 +145,14 @@ logging in. >>> response = c.get('/lists/new/') + +Then we check that everything went well. + >>> response.status_code + 200 + >>> print "Create a new list" in response.content True - + Now create a new list called 'new_list'. We should end up on a redirect >>> response = c.post('/lists/new/', @@ -146,9 +168,13 @@ List index page should now include the realname of the list >>> response = c.get('/lists/',HTTP_HOST='example.com') + +Then we check that everything went well. + >>> response.status_code + 200 >>> "New_list1" in response.content True - + List Summary ================= @@ -158,6 +184,10 @@ 4. to unsubscribe >>> response = c.get('/lists/new_list1%40mail.example.com/',) + +Then we check that everything went well. + >>> response.status_code + 200 >>> "Subscribe" in response.content True >>> "Archives" in response.content @@ -166,13 +196,17 @@ True >>> "Unsubscribe" in response.content True - + Subscriptions ==================== Get the Subscriptions Page and check that the form was prefilled with the users E-Mail >>> url = '/subscriptions/new_list1%40mail.example.com/subscribe' >>> response = c.get(url) + +Then we check that everything went well. + >>> response.status_code + 200 >>> "james@example.com" in response.content True @@ -203,7 +237,7 @@ ... "fqdn_listname": "new_list1@mail.example.com"}) >>> print (_('Unsubscribed')+' katie@example.com') in response.content True - + Mass Subscribe Users (within settings) ====================