chore(cleanups): cleanup unicode usage...
This commit is contained in:
parent
e013e4ca46
commit
8f1e706ad8
9 changed files with 17 additions and 17 deletions
|
|
@ -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),
|
||||
])
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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ę'
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
|
|||
|
||||
@hybrid_property
|
||||
def name(self):
|
||||
return u"external_test"
|
||||
return "external_test"
|
||||
|
||||
def settings(self):
|
||||
settings = [
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -145,14 +145,14 @@ def test_unicode_refs(vcsbackend, filename, content, branch, mime_type):
|
|||
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'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue