Changeset - 29d0ed59e674
[Not reviewed]
default
0 8 0
Thomas De Schampheleire - 10 years ago 2015-06-20 21:40:59
thomas.de.schampheleire@gmail.com
tests: remove hardcoded test_admin username
8 files changed with 22 insertions and 22 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_admin_gists.py
Show inline comments
 
@@ -154,7 +154,7 @@ class TestGistsController(TestController
 
        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('<div class="btn btn-mini btn-success disabled">Public Gist</div>')
 

	
kallithea/tests/functional/test_changeset_comments.py
Show inline comments
 
@@ -127,7 +127,7 @@ class TestChangeSetCommentsController(Te
 
        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()
kallithea/tests/functional/test_followers.py
Show inline comments
 
@@ -10,7 +10,7 @@ class TestFollowersController(TestContro
 
                                    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 @@ class TestFollowersController(TestContro
 
                                    action='followers',
 
                                    repo_name=repo_name))
 

	
 
        response.mustcontain("""test_admin""")
 
        response.mustcontain(TEST_USER_ADMIN_LOGIN)
 
        response.mustcontain("""Started following""")
kallithea/tests/functional/test_journal.py
Show inline comments
 
@@ -12,7 +12,7 @@ class TestJournalController(TestControll
 

	
 
    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)\
kallithea/tests/functional/test_login.py
Show inline comments
 
@@ -30,11 +30,11 @@ class TestLoginController(TestController
 

	
 
    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 @@ class TestLoginController(TestController
 
        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 @@ class TestLoginController(TestController
 
    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 @@ class TestLoginController(TestController
 

	
 
    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 @@ class TestLoginController(TestController
 
        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 @@ class TestLoginController(TestController
 
        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 @@ class TestLoginController(TestController
 
                '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',
kallithea/tests/functional/test_my_account.py
Show inline comments
 
@@ -23,7 +23,7 @@ class TestMyAccountController(TestContro
 
        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 @@ class TestMyAccountController(TestContro
 
        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 @@ class TestMyAccountController(TestContro
 
        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 @@ class TestMyAccountController(TestContro
 
        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):
kallithea/tests/functional/test_summary.py
Show inline comments
 
@@ -41,8 +41,8 @@ class TestSummaryController(TestControll
 
        )
 

	
 
        # 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 @@ class TestSummaryController(TestControll
 
        )
 

	
 
        # 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()
kallithea/tests/scripts/manual_test_concurrency.py
Show inline comments
 
@@ -54,7 +54,7 @@ load_environment(conf.global_conf, conf.
 

	
 
add_cache(conf)
 

	
 
USER = 'test_admin'
 
USER = TEST_USER_ADMIN_LOGIN
 
PASS = 'test12'
 
HOST = 'server.local'
 
METHOD = 'pull'
0 comments (0 inline, 0 general)