# HG changeset patch # User Thomas De Schampheleire # Date 1434829259 -7200 # Node ID 29d0ed59e6742dafe8386edbe6da03e76039507a # Parent 90e982b6bca805a574f6dc7f7535169d827ea3fa tests: remove hardcoded test_admin username diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_admin_gists.py --- a/kallithea/tests/functional/test_admin_gists.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_admin_gists.py Sat Jun 20 21:40:59 2015 +0200 @@ -154,7 +154,7 @@ gist = _create_gist('gist-show-me') response = self.app.get(url('gist', gist_id=gist.gist_access_id)) response.mustcontain('added file: gist-show-me<') - response.mustcontain('test_admin - created') + response.mustcontain('%s - created' % TEST_USER_ADMIN_LOGIN) response.mustcontain('gist-desc') response.mustcontain('
Public Gist
') diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_changeset_comments.py --- a/kallithea/tests/functional/test_changeset_comments.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_changeset_comments.py Sat Jun 20 21:40:59 2015 +0200 @@ -127,7 +127,7 @@ users = [x.user.username for x in UserNotification.query().all()] # test_regular gets notification by @mention - self.assertEqual(sorted(users), [u'test_admin', u'test_regular']) + self.assertEqual(sorted(users), [TEST_USER_ADMIN_LOGIN, u'test_regular']) def test_delete(self): self.log_user() diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_followers.py --- a/kallithea/tests/functional/test_followers.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_followers.py Sat Jun 20 21:40:59 2015 +0200 @@ -10,7 +10,7 @@ action='followers', repo_name=repo_name)) - response.mustcontain("""test_admin""") + response.mustcontain(TEST_USER_ADMIN_LOGIN) response.mustcontain("""Started following""") def test_index_git(self): @@ -20,5 +20,5 @@ action='followers', repo_name=repo_name)) - response.mustcontain("""test_admin""") + response.mustcontain(TEST_USER_ADMIN_LOGIN) response.mustcontain("""Started following""") diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_journal.py --- a/kallithea/tests/functional/test_journal.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_journal.py Sat Jun 20 21:40:59 2015 +0200 @@ -12,7 +12,7 @@ def test_stop_following_repository(self): session = self.log_user() -# usr = Session().query(User).filter(User.username == 'test_admin').one() +# usr = Session().query(User).filter(User.username == TEST_USER_ADMIN_LOGIN).one() # repo = Session().query(Repository).filter(Repository.repo_name == HG_REPO).one() # # followings = Session().query(UserFollowing)\ diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_login.py --- a/kallithea/tests/functional/test_login.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_login.py Sat Jun 20 21:40:59 2015 +0200 @@ -30,11 +30,11 @@ def test_login_admin_ok(self): response = self.app.post(url(controller='login', action='index'), - {'username': 'test_admin', + {'username': TEST_USER_ADMIN_LOGIN, 'password': 'test12'}) self.assertEqual(response.status, '302 Found') self.assertEqual(response.session['authuser'].get('username'), - 'test_admin') + TEST_USER_ADMIN_LOGIN) response = response.follow() response.mustcontain('/%s' % HG_REPO) @@ -53,7 +53,7 @@ test_came_from = '/_admin/users' response = self.app.post(url(controller='login', action='index', came_from=test_came_from), - {'username': 'test_admin', + {'username': TEST_USER_ADMIN_LOGIN, 'password': 'test12'}) self.assertEqual(response.status, '302 Found') response = response.follow() @@ -87,7 +87,7 @@ def test_login_bad_came_froms(self, url_came_from): response = self.app.post(url(controller='login', action='index', came_from=url_came_from), - {'username': 'test_admin', + {'username': TEST_USER_ADMIN_LOGIN, 'password': 'test12'}) self.assertEqual(response.status, '302 Found') self.assertEqual(response._environ['paste.testing_variables'] @@ -98,7 +98,7 @@ def test_login_short_password(self): response = self.app.post(url(controller='login', action='index'), - {'username': 'test_admin', + {'username': TEST_USER_ADMIN_LOGIN, 'password': 'as'}) self.assertEqual(response.status, '200 OK') @@ -149,7 +149,7 @@ response = self.app.post(url(controller='login', action='index', came_from = '/_admin/users', **args), - {'username': 'test_admin', + {'username': TEST_USER_ADMIN_LOGIN, 'password': 'test12'}) self.assertEqual(response.status, '302 Found') for encoded in args_encoded: @@ -180,7 +180,7 @@ response.mustcontain('Sign Up') def test_register_err_same_username(self): - uname = 'test_admin' + uname = TEST_USER_ADMIN_LOGIN response = self.app.post(url(controller='login', action='register'), {'username': uname, 'password': 'test12', @@ -244,7 +244,7 @@ 'alphanumeric character') def test_register_err_case_sensitive(self): - usr = 'Test_Admin' + usr = TEST_USER_ADMIN_LOGIN.title() response = self.app.post(url(controller='login', action='register'), {'username': usr, 'password': 'test12', diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_my_account.py --- a/kallithea/tests/functional/test_my_account.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_my_account.py Sat Jun 20 21:40:59 2015 +0200 @@ -23,7 +23,7 @@ self.log_user() response = self.app.get(url('my_account')) - response.mustcontain('value="test_admin') + response.mustcontain('value="%s' % TEST_USER_ADMIN_LOGIN) def test_my_account_my_repos(self): self.log_user() @@ -152,7 +152,7 @@ new_email = 'test_regular@mail.com' # already exisitn email response = self.app.post(url('my_account'), params=dict( - username='test_admin', + username=TEST_USER_ADMIN_LOGIN, new_password='test12', password_confirmation='test122', firstname='NewName', @@ -169,7 +169,7 @@ new_email = 'newmail.pl' response = self.app.post(url('my_account'), params=dict( - username='test_admin', + username=TEST_USER_ADMIN_LOGIN, new_password='test12', password_confirmation='test122', firstname='NewName', @@ -181,7 +181,7 @@ from kallithea.model import validators msg = validators.ValidUsername(edit=False, old_data={})\ ._messages['username_exists'] - msg = h.html_escape(msg % {'username': 'test_admin'}) + msg = h.html_escape(msg % {'username': TEST_USER_ADMIN_LOGIN}) response.mustcontain(u"%s" % msg) def test_my_account_api_keys(self): diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/functional/test_summary.py --- a/kallithea/tests/functional/test_summary.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/functional/test_summary.py Sat Jun 20 21:40:59 2015 +0200 @@ -41,8 +41,8 @@ ) # clone url... - response.mustcontain('''id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/%s"''' % HG_REPO) - response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_%s"''' % ID) + response.mustcontain('''id="clone_url" readonly="readonly" value="http://%s@localhost:80/%s"''' % (TEST_USER_ADMIN_LOGIN, HG_REPO)) + response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://%s@localhost:80/_%s"''' % (TEST_USER_ADMIN_LOGIN, ID)) def test_index_git(self): self.log_user() @@ -61,8 +61,8 @@ ) # clone url... - response.mustcontain('''id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/%s"''' % GIT_REPO) - response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://test_admin@localhost:80/_%s"''' % ID) + response.mustcontain('''id="clone_url" readonly="readonly" value="http://%s@localhost:80/%s"''' % (TEST_USER_ADMIN_LOGIN, GIT_REPO)) + response.mustcontain('''id="clone_url_id" readonly="readonly" value="http://%s@localhost:80/_%s"''' % (TEST_USER_ADMIN_LOGIN, ID)) def test_index_by_id_hg(self): self.log_user() diff -r 90e982b6bca8 -r 29d0ed59e674 kallithea/tests/scripts/manual_test_concurrency.py --- a/kallithea/tests/scripts/manual_test_concurrency.py Fri Jun 19 15:42:50 2015 +0200 +++ b/kallithea/tests/scripts/manual_test_concurrency.py Sat Jun 20 21:40:59 2015 +0200 @@ -54,7 +54,7 @@ add_cache(conf) -USER = 'test_admin' +USER = TEST_USER_ADMIN_LOGIN PASS = 'test12' HOST = 'server.local' METHOD = 'pull'