Show More
@@ -41,7 +41,7 b' class TestCreateRepo(object):' | |||||
41 | @pytest.mark.parametrize('given, expected_name, expected_exc', [ |
|
41 | @pytest.mark.parametrize('given, expected_name, expected_exc', [ | |
42 | ('api repo-1', 'api-repo-1', False), |
|
42 | ('api repo-1', 'api-repo-1', False), | |
43 | ('api-repo 1-ąć', 'api-repo-1-ąć', False), |
|
43 | ('api-repo 1-ąć', 'api-repo-1-ąć', False), | |
44 |
( |
|
44 | ('unicode-ąć', u'unicode-ąć', False), | |
45 | ('some repo v1.2', 'some-repo-v1.2', False), |
|
45 | ('some repo v1.2', 'some-repo-v1.2', False), | |
46 | ('v2.0', 'v2.0', False), |
|
46 | ('v2.0', 'v2.0', False), | |
47 | ]) |
|
47 | ]) |
@@ -211,8 +211,8 b' class TestCreateRepoGroup(object):' | |||||
211 |
|
211 | |||
212 | expected = { |
|
212 | expected = { | |
213 | 'repo_group': |
|
213 | 'repo_group': | |
214 |
|
|
214 | 'You do not have the permission to store ' | |
215 |
|
|
215 | 'repository groups in the root location.'} | |
216 | assert_error(id_, expected, given=response.body) |
|
216 | assert_error(id_, expected, given=response.body) | |
217 |
|
217 | |||
218 | def test_api_create_repo_group_regular_user_no_parent_group_perms(self): |
|
218 | def test_api_create_repo_group_regular_user_no_parent_group_perms(self): | |
@@ -232,8 +232,8 b' class TestCreateRepoGroup(object):' | |||||
232 |
|
232 | |||
233 | expected = { |
|
233 | expected = { | |
234 | 'repo_group': |
|
234 | 'repo_group': | |
235 |
|
|
235 | "You do not have the permissions to store " | |
236 |
|
|
236 | "repository groups inside repository group `{}`".format(repo_group_name)} | |
237 | try: |
|
237 | try: | |
238 | assert_error(id_, expected, given=response.body) |
|
238 | assert_error(id_, expected, given=response.body) | |
239 | finally: |
|
239 | finally: |
@@ -76,8 +76,8 b' class TestApiGetGist(object):' | |||||
76 | 'url': 'http://%s/_admin/gists/%s' % (http_host_only_stub, gist_id,), |
|
76 | 'url': 'http://%s/_admin/gists/%s' % (http_host_only_stub, gist_id,), | |
77 | 'acl_level': Gist.ACL_LEVEL_PUBLIC, |
|
77 | 'acl_level': Gist.ACL_LEVEL_PUBLIC, | |
78 | 'content': { |
|
78 | 'content': { | |
79 |
|
|
79 | 'filename1.txt': 'hello world', | |
80 |
|
|
80 | 'filename1ą.txt': 'hello worldę' | |
81 | }, |
|
81 | }, | |
82 | } |
|
82 | } | |
83 |
|
83 |
@@ -446,8 +446,8 b' class TestAdminRepos(object):' | |||||
446 | csrf_token=csrf_token)) |
|
446 | csrf_token=csrf_token)) | |
447 |
|
447 | |||
448 | response.mustcontain( |
|
448 | response.mustcontain( | |
449 |
|
|
449 | "You do not have the permission to store repositories in " | |
450 |
|
|
450 | "the root location.") | |
451 |
|
451 | |||
452 | @mock.patch.object(RepoModel, '_create_filesystem_repo', error_function) |
|
452 | @mock.patch.object(RepoModel, '_create_filesystem_repo', error_function) | |
453 | def test_create_repo_when_filesystem_op_fails( |
|
453 | def test_create_repo_when_filesystem_op_fails( |
@@ -266,7 +266,7 b' class TestLoginController(object):' | |||||
266 | ) |
|
266 | ) | |
267 |
|
267 | |||
268 | assertr = response.assert_response() |
|
268 | assertr = response.assert_response() | |
269 |
msg = |
|
269 | msg = 'This e-mail address is already taken' | |
270 | assertr.element_contains('#email+.error-message', msg) |
|
270 | assertr.element_contains('#email+.error-message', msg) | |
271 |
|
271 | |||
272 | def test_register_err_same_email_case_sensitive(self): |
|
272 | def test_register_err_same_email_case_sensitive(self): | |
@@ -282,7 +282,7 b' class TestLoginController(object):' | |||||
282 | } |
|
282 | } | |
283 | ) |
|
283 | ) | |
284 | assertr = response.assert_response() |
|
284 | assertr = response.assert_response() | |
285 |
msg = |
|
285 | msg = 'This e-mail address is already taken' | |
286 | assertr.element_contains('#email+.error-message', msg) |
|
286 | assertr.element_contains('#email+.error-message', msg) | |
287 |
|
287 | |||
288 | def test_register_err_wrong_data(self): |
|
288 | def test_register_err_wrong_data(self): |
@@ -44,7 +44,7 b' class RhodeCodeAuthPlugin(RhodeCodeExter' | |||||
44 |
|
44 | |||
45 | @hybrid_property |
|
45 | @hybrid_property | |
46 | def name(self): |
|
46 | def name(self): | |
47 |
return |
|
47 | return "external_test" | |
48 |
|
48 | |||
49 | def settings(self): |
|
49 | def settings(self): | |
50 | settings = [ |
|
50 | settings = [ |
@@ -29,7 +29,7 b' from rhodecode.model import db' | |||||
29 | class RcTestAuthPlugin(RhodeCodeAuthPluginBase): |
|
29 | class RcTestAuthPlugin(RhodeCodeAuthPluginBase): | |
30 |
|
30 | |||
31 | def name(self): |
|
31 | def name(self): | |
32 |
return |
|
32 | return 'stub_auth' | |
33 |
|
33 | |||
34 |
|
34 | |||
35 | def test_authenticate_returns_from_auth(stub_auth_data): |
|
35 | def test_authenticate_returns_from_auth(stub_auth_data): |
@@ -969,7 +969,7 b' class TestGitCommit(object):' | |||||
969 | branches = self.repo.branches |
|
969 | branches = self.repo.branches | |
970 |
|
970 | |||
971 | assert 'unicode' in branches |
|
971 | assert 'unicode' in branches | |
972 |
assert |
|
972 | assert 'uniçö∂e' in branches | |
973 |
|
973 | |||
974 | def test_unicode_tag_refs(self): |
|
974 | def test_unicode_tag_refs(self): | |
975 | unicode_tags = { |
|
975 | unicode_tags = { | |
@@ -983,7 +983,7 b' class TestGitCommit(object):' | |||||
983 | tags = self.repo.tags |
|
983 | tags = self.repo.tags | |
984 |
|
984 | |||
985 | assert 'unicode' in tags |
|
985 | assert 'unicode' in tags | |
986 |
assert |
|
986 | assert 'uniçö∂e' in tags | |
987 |
|
987 | |||
988 | def test_commit_message_is_unicode(self): |
|
988 | def test_commit_message_is_unicode(self): | |
989 | for commit in self.repo: |
|
989 | for commit in self.repo: |
@@ -145,14 +145,14 b' def test_unicode_refs(vcsbackend, filena' | |||||
145 | with mock.patch(("rhodecode.lib.vcs.backends.svn.repository" |
|
145 | with mock.patch(("rhodecode.lib.vcs.backends.svn.repository" | |
146 | ".SubversionRepository._patterns_from_section"), |
|
146 | ".SubversionRepository._patterns_from_section"), | |
147 | return_value=['branches/*']): |
|
147 | return_value=['branches/*']): | |
148 |
assert |
|
148 | assert f'branches/{branch}' in repo.branches | |
149 |
|
149 | |||
150 |
|
150 | |||
151 | def test_compatible_version(monkeypatch, vcsbackend): |
|
151 | def test_compatible_version(monkeypatch, vcsbackend): | |
152 | monkeypatch.setattr(settings, 'SVN_COMPATIBLE_VERSION', 'pre-1.8-compatible') |
|
152 | monkeypatch.setattr(settings, 'SVN_COMPATIBLE_VERSION', 'pre-1.8-compatible') | |
153 | path = vcsbackend.new_repo_path() |
|
153 | path = vcsbackend.new_repo_path() | |
154 | SubversionRepository(path, create=True) |
|
154 | SubversionRepository(path, create=True) | |
155 |
with open('{}/db/format' |
|
155 | with open(f'{path}/db/format') as f: | |
156 | first_line = f.readline().strip() |
|
156 | first_line = f.readline().strip() | |
157 | assert first_line == '4' |
|
157 | assert first_line == '4' | |
158 |
|
158 |
General Comments 0
You need to be logged in to leave comments.
Login now