# HG changeset patch # User RhodeCode Admin # Date 2024-06-23 19:48:10 # Node ID c08e0f364515a5de7a34cfe7d510821e6b38a956 # Parent c65da3484ef84ee9e0d20262f6b650034d73c15b chore(cleanups): cleanup unicode usage... diff --git a/rhodecode/api/tests/test_create_repo.py b/rhodecode/api/tests/test_create_repo.py --- a/rhodecode/api/tests/test_create_repo.py +++ b/rhodecode/api/tests/test_create_repo.py @@ -41,7 +41,7 @@ class TestCreateRepo(object): @pytest.mark.parametrize('given, expected_name, expected_exc', [ ('api repo-1', 'api-repo-1', False), ('api-repo 1-ąć', 'api-repo-1-ąć', False), - (u'unicode-ąć', u'unicode-ąć', False), + ('unicode-ąć', u'unicode-ąć', False), ('some repo v1.2', 'some-repo-v1.2', False), ('v2.0', 'v2.0', False), ]) diff --git a/rhodecode/api/tests/test_create_repo_group.py b/rhodecode/api/tests/test_create_repo_group.py --- a/rhodecode/api/tests/test_create_repo_group.py +++ b/rhodecode/api/tests/test_create_repo_group.py @@ -211,8 +211,8 @@ class TestCreateRepoGroup(object): expected = { 'repo_group': - u'You do not have the permission to store ' - u'repository groups in the root location.'} + 'You do not have the permission to store ' + 'repository groups in the root location.'} assert_error(id_, expected, given=response.body) def test_api_create_repo_group_regular_user_no_parent_group_perms(self): @@ -232,8 +232,8 @@ class TestCreateRepoGroup(object): expected = { 'repo_group': - u"You do not have the permissions to store " - u"repository groups inside repository group `{}`".format(repo_group_name)} + "You do not have the permissions to store " + "repository groups inside repository group `{}`".format(repo_group_name)} try: assert_error(id_, expected, given=response.body) finally: diff --git a/rhodecode/api/tests/test_get_gist.py b/rhodecode/api/tests/test_get_gist.py --- a/rhodecode/api/tests/test_get_gist.py +++ b/rhodecode/api/tests/test_get_gist.py @@ -76,8 +76,8 @@ class TestApiGetGist(object): 'url': 'http://%s/_admin/gists/%s' % (http_host_only_stub, gist_id,), 'acl_level': Gist.ACL_LEVEL_PUBLIC, 'content': { - u'filename1.txt': u'hello world', - u'filename1ą.txt': u'hello worldę' + 'filename1.txt': 'hello world', + 'filename1ą.txt': 'hello worldę' }, } diff --git a/rhodecode/apps/admin/tests/test_admin_repos.py b/rhodecode/apps/admin/tests/test_admin_repos.py --- a/rhodecode/apps/admin/tests/test_admin_repos.py +++ b/rhodecode/apps/admin/tests/test_admin_repos.py @@ -446,8 +446,8 @@ class TestAdminRepos(object): csrf_token=csrf_token)) response.mustcontain( - u"You do not have the permission to store repositories in " - u"the root location.") + "You do not have the permission to store repositories in " + "the root location.") @mock.patch.object(RepoModel, '_create_filesystem_repo', error_function) def test_create_repo_when_filesystem_op_fails( diff --git a/rhodecode/apps/login/tests/test_login.py b/rhodecode/apps/login/tests/test_login.py --- a/rhodecode/apps/login/tests/test_login.py +++ b/rhodecode/apps/login/tests/test_login.py @@ -266,7 +266,7 @@ class TestLoginController(object): ) assertr = response.assert_response() - msg = u'This e-mail address is already taken' + msg = 'This e-mail address is already taken' assertr.element_contains('#email+.error-message', msg) def test_register_err_same_email_case_sensitive(self): @@ -282,7 +282,7 @@ class TestLoginController(object): } ) assertr = response.assert_response() - msg = u'This e-mail address is already taken' + msg = 'This e-mail address is already taken' assertr.element_contains('#email+.error-message', msg) def test_register_err_wrong_data(self): diff --git a/rhodecode/tests/auth_external_test.py b/rhodecode/tests/auth_external_test.py --- a/rhodecode/tests/auth_external_test.py +++ b/rhodecode/tests/auth_external_test.py @@ -44,7 +44,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExter @hybrid_property def name(self): - return u"external_test" + return "external_test" def settings(self): settings = [ diff --git a/rhodecode/tests/lib/auth_modules/test_auth_modules.py b/rhodecode/tests/lib/auth_modules/test_auth_modules.py --- a/rhodecode/tests/lib/auth_modules/test_auth_modules.py +++ b/rhodecode/tests/lib/auth_modules/test_auth_modules.py @@ -29,7 +29,7 @@ from rhodecode.model import db class RcTestAuthPlugin(RhodeCodeAuthPluginBase): def name(self): - return u'stub_auth' + return 'stub_auth' def test_authenticate_returns_from_auth(stub_auth_data): diff --git a/rhodecode/tests/vcs/test_git.py b/rhodecode/tests/vcs/test_git.py --- a/rhodecode/tests/vcs/test_git.py +++ b/rhodecode/tests/vcs/test_git.py @@ -969,7 +969,7 @@ class TestGitCommit(object): branches = self.repo.branches assert 'unicode' in branches - assert u'uniçö∂e' in branches + assert 'uniçö∂e' in branches def test_unicode_tag_refs(self): unicode_tags = { @@ -983,7 +983,7 @@ class TestGitCommit(object): tags = self.repo.tags assert 'unicode' in tags - assert u'uniçö∂e' in tags + assert 'uniçö∂e' in tags def test_commit_message_is_unicode(self): for commit in self.repo: diff --git a/rhodecode/tests/vcs/test_svn.py b/rhodecode/tests/vcs/test_svn.py --- a/rhodecode/tests/vcs/test_svn.py +++ b/rhodecode/tests/vcs/test_svn.py @@ -145,14 +145,14 @@ def test_unicode_refs(vcsbackend, filena with mock.patch(("rhodecode.lib.vcs.backends.svn.repository" ".SubversionRepository._patterns_from_section"), return_value=['branches/*']): - assert u'branches/{0}'.format(branch) in repo.branches + assert f'branches/{branch}' in repo.branches def test_compatible_version(monkeypatch, vcsbackend): monkeypatch.setattr(settings, 'SVN_COMPATIBLE_VERSION', 'pre-1.8-compatible') path = vcsbackend.new_repo_path() SubversionRepository(path, create=True) - with open('{}/db/format'.format(path)) as f: + with open(f'{path}/db/format') as f: first_line = f.readline().strip() assert first_line == '4'