Example #1
0
 def test_newuser_success(self):
   self.set_post({
     'user_email' : '*****@*****.**',
     'user_password' : 'aaaaaa',
     'user_password_confirmation' : 'aaaaaa',
   })
   page = NewUserPage(self.request, self.response)
   page.redirect = self.response.redirect
   page.post()
   self.assertTrue(AppDashboardHelper.DEV_APPSERVER_LOGIN_COOKIE in self.response.cookies)
   self.assertEqual(self.response.redirect_location, '/')
Example #2
0
 def test_newuser_success(self):
   self.set_post({
     'user_email' : '*****@*****.**',
     'user_password' : 'aaaaaa',
     'user_password_confirmation' : 'aaaaaa',
   })
   page = NewUserPage(self.request, self.response)
   page.redirect = self.response.redirect
   page.post()
   self.assertTrue(AppDashboardHelper.DEV_APPSERVER_LOGIN_COOKIE in self.response.cookies)
   self.assertEqual(self.response.redirect_location, '/')
Example #3
0
 def test_newuser_page(self):
     NewUserPage(self.request, self.response).get()
     html = self.response.out.getvalue()
     self.assertTrue(
         re.search('<!-- FILE:templates/layouts/main.html -->', html))
     self.assertTrue(
         re.search('<!-- FILE:templates/users/new.html -->', html))
Example #4
0
 def test_newuser_passwdnomatch(self):
   self.set_post({
     'user_email' : '*****@*****.**',
     'user_password' : 'aaaaa',
     'user_password_confirmation' : 'aaabbb',
   })
   NewUserPage(self.request, self.response).post()
   html =  self.response.out.getvalue()
   self.assertTrue(re.search('<!-- FILE:templates/layouts/main.html -->', html))
   self.assertTrue(re.search('<!-- FILE:templates/users/new.html -->', html))
   self.assertTrue(re.search('Passwords do not match.', html))
Example #5
0
 def test_newuser_shortpasswd(self):
   self.set_post({
     'user_email' : '*****@*****.**',
     'user_password' : 'aaa',
     'user_password_confirmation' : 'aaa',
   })
   NewUserPage(self.request, self.response).post()
   html =  self.response.out.getvalue()
   self.assertTrue(re.search('<!-- FILE:templates/layouts/main.html -->', html))
   self.assertTrue(re.search('<!-- FILE:templates/users/new.html -->', html))
   self.assertTrue(re.search('Password must be at least 6 characters long.', html))
Example #6
0
 def test_newuser_bademail(self):
   self.set_post({
     'user_email' : 'c@a',
     'user_password' : 'aaaaaa',
     'user_password_confirmation' : 'aaaaaa',
   })
   NewUserPage(self.request, self.response).post()
   html =  self.response.out.getvalue()
   self.assertTrue(re.search('<!-- FILE:templates/layouts/main.html -->', html))
   self.assertTrue(re.search('<!-- FILE:templates/users/new.html -->', html))
   self.assertTrue(re.search('Format must be [email protected].', html))