[PATCH 3 of 7] tests: remove hardcoded test_regular username

Thomas De Schampheleire patrickdepinguin at gmail.com
Sat Jun 20 16:37:56 EDT 2015


# HG changeset patch
# User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
# Date 1434832009 -7200
#      Sat Jun 20 22:26:49 2015 +0200
# Node ID 087a949ad8b7d7ecd5416d5fca89ec2953f33eaf
# Parent  f60ea96cc104a334e336e03c38c3d99b86f7f1a6
tests: remove hardcoded test_regular username

diff --git a/kallithea/tests/functional/test_changeset_comments.py b/kallithea/tests/functional/test_changeset_comments.py
--- a/kallithea/tests/functional/test_changeset_comments.py
+++ b/kallithea/tests/functional/test_changeset_comments.py
@@ -104,7 +104,7 @@ class TestChangeSetCommentsController(Te
         self.log_user()
 
         rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
-        text = u'@test_regular check CommentOnRevision'
+        text = u'@%s check CommentOnRevision' % TEST_USER_REGULAR_LOGIN
 
         params = {'text': text, '_authentication_token': self.authentication_token()}
         response = self.app.post(url(controller='changeset', action='comment',
@@ -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), [TEST_USER_ADMIN_LOGIN, u'test_regular'])
+        self.assertEqual(sorted(users), [TEST_USER_ADMIN_LOGIN, TEST_USER_REGULAR_LOGIN])
 
     def test_delete(self):
         self.log_user()
diff --git a/kallithea/tests/functional/test_login.py b/kallithea/tests/functional/test_login.py
--- a/kallithea/tests/functional/test_login.py
+++ b/kallithea/tests/functional/test_login.py
@@ -40,12 +40,12 @@ class TestLoginController(TestController
 
     def test_login_regular_ok(self):
         response = self.app.post(url(controller='login', action='index'),
-                                 {'username': 'test_regular',
+                                 {'username': TEST_USER_REGULAR_LOGIN,
                                   'password': 'test12'})
 
         self.assertEqual(response.status, '302 Found')
         self.assertEqual(response.session['authuser'].get('username'),
-                         'test_regular')
+                         TEST_USER_REGULAR_LOGIN)
         response = response.follow()
         response.mustcontain('/%s' % HG_REPO)
 
@@ -63,7 +63,7 @@ class TestLoginController(TestController
 
     def test_logout(self):
         response = self.app.post(url(controller='login', action='index'),
-                                 {'username': 'test_regular',
+                                 {'username': TEST_USER_REGULAR_LOGIN,
                                   'password': 'test12'})
 
         # Verify that a login session has been established.


More information about the kallithea-general mailing list