changeset 5207:222a36d30368

tests: remove hardcoded test passwords
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Sat, 20 Jun 2015 21:56:56 +0200
parents 414142964b62
children b8c657874b7a
files kallithea/tests/functional/test_login.py kallithea/tests/functional/test_my_account.py kallithea/tests/scripts/manual_test_concurrency.py
diffstat 3 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/functional/test_login.py	Sat Jun 20 22:31:44 2015 +0200
+++ b/kallithea/tests/functional/test_login.py	Sat Jun 20 21:56:56 2015 +0200
@@ -31,7 +31,7 @@
     def test_login_admin_ok(self):
         response = self.app.post(url(controller='login', action='index'),
                                  {'username': TEST_USER_ADMIN_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_ADMIN_PASS})
         self.assertEqual(response.status, '302 Found')
         self.assertEqual(response.session['authuser'].get('username'),
                          TEST_USER_ADMIN_LOGIN)
@@ -41,7 +41,7 @@
     def test_login_regular_ok(self):
         response = self.app.post(url(controller='login', action='index'),
                                  {'username': TEST_USER_REGULAR_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_REGULAR_PASS})
 
         self.assertEqual(response.status, '302 Found')
         self.assertEqual(response.session['authuser'].get('username'),
@@ -54,7 +54,7 @@
         response = self.app.post(url(controller='login', action='index',
                                      came_from=test_came_from),
                                  {'username': TEST_USER_ADMIN_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_ADMIN_PASS})
         self.assertEqual(response.status, '302 Found')
         response = response.follow()
 
@@ -64,7 +64,7 @@
     def test_logout(self):
         response = self.app.post(url(controller='login', action='index'),
                                  {'username': TEST_USER_REGULAR_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_REGULAR_PASS})
 
         # Verify that a login session has been established.
         response = self.app.get(url(controller='login', action='index'))
@@ -88,7 +88,7 @@
         response = self.app.post(url(controller='login', action='index',
                                      came_from=url_came_from),
                                  {'username': TEST_USER_ADMIN_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_ADMIN_PASS})
         self.assertEqual(response.status, '302 Found')
         self.assertEqual(response._environ['paste.testing_variables']
                          ['tmpl_context'].came_from, '/')
@@ -150,7 +150,7 @@
                                      came_from = '/_admin/users',
                                      **args),
                                  {'username': TEST_USER_ADMIN_LOGIN,
-                                  'password': 'test12'})
+                                  'password': TEST_USER_ADMIN_PASS})
         self.assertEqual(response.status, '302 Found')
         for encoded in args_encoded:
             self.assertIn(encoded, response.location)
--- a/kallithea/tests/functional/test_my_account.py	Sat Jun 20 22:31:44 2015 +0200
+++ b/kallithea/tests/functional/test_my_account.py	Sat Jun 20 21:56:56 2015 +0200
@@ -153,7 +153,7 @@
         response = self.app.post(url('my_account'),
                                 params=dict(
                                     username=TEST_USER_ADMIN_LOGIN,
-                                    new_password='test12',
+                                    new_password=TEST_USER_ADMIN_PASS,
                                     password_confirmation='test122',
                                     firstname='NewName',
                                     lastname='NewLastname',
@@ -164,13 +164,13 @@
         response.mustcontain('This e-mail address is already taken')
 
     def test_my_account_update_err(self):
-        self.log_user(TEST_USER_REGULAR2_LOGIN, 'test12')
+        self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)
 
         new_email = 'newmail.pl'
         response = self.app.post(url('my_account'),
                                  params=dict(
                                             username=TEST_USER_ADMIN_LOGIN,
-                                            new_password='test12',
+                                            new_password=TEST_USER_ADMIN_PASS,
                                             password_confirmation='test122',
                                             firstname='NewName',
                                             lastname='NewLastname',
@@ -185,7 +185,7 @@
         response.mustcontain(u"%s" % msg)
 
     def test_my_account_api_keys(self):
-        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, 'test12')
+        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)
         user = User.get(usr['user_id'])
         response = self.app.get(url('my_account_api_keys'))
         response.mustcontain(user.api_key)
@@ -197,7 +197,7 @@
         ('30days', 60*60*24*30),
     ])
     def test_my_account_add_api_keys(self, desc, lifetime):
-        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, 'test12')
+        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)
         user = User.get(usr['user_id'])
         response = self.app.post(url('my_account_api_keys'),
                                  {'description': desc, 'lifetime': lifetime, '_authentication_token': self.authentication_token()})
@@ -213,7 +213,7 @@
                 Session().commit()
 
     def test_my_account_remove_api_key(self):
-        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, 'test12')
+        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)
         user = User.get(usr['user_id'])
         response = self.app.post(url('my_account_api_keys'),
                                  {'description': 'desc', 'lifetime': -1, '_authentication_token': self.authentication_token()})
@@ -232,7 +232,7 @@
 
 
     def test_my_account_reset_main_api_key(self):
-        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, 'test12')
+        usr = self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)
         user = User.get(usr['user_id'])
         api_key = user.api_key
         response = self.app.get(url('my_account_api_keys'))
--- a/kallithea/tests/scripts/manual_test_concurrency.py	Sat Jun 20 22:31:44 2015 +0200
+++ b/kallithea/tests/scripts/manual_test_concurrency.py	Sat Jun 20 21:56:56 2015 +0200
@@ -55,7 +55,7 @@
 add_cache(conf)
 
 USER = TEST_USER_ADMIN_LOGIN
-PASS = 'test12'
+PASS = TEST_USER_ADMIN_PASS
 HOST = 'server.local'
 METHOD = 'pull'
 DEBUG = True