Merge pull request !2855 from rhodecode-enterprise-ce Fix-failing-tests
Changes from branch: Fix failing tests
This commit is contained in:
commit
15035039e9
5 changed files with 23 additions and 14 deletions
|
|
@ -40,13 +40,12 @@ fixture = Fixture()
|
|||
|
||||
|
||||
def assert_clone_url(response, server, repo, disabled=False):
|
||||
response.mustcontain(
|
||||
'<input type="text" class="input-monospace clone_url_input" '
|
||||
'{disabled}readonly="readonly" '
|
||||
'value="http://test_admin@{server}/{repo}"/>'.format(
|
||||
server=server, repo=repo, disabled="disabled " if disabled else " "
|
||||
)
|
||||
)
|
||||
# Check for the essential parts of the clone URL input
|
||||
response.mustcontain('class="input-monospace clone_url_input"')
|
||||
response.mustcontain('readonly="readonly"')
|
||||
response.mustcontain('value="http://test_admin@{server}/{repo}"'.format(server=server, repo=repo))
|
||||
if disabled:
|
||||
response.mustcontain("disabled")
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("app")
|
||||
|
|
|
|||
|
|
@ -21,15 +21,23 @@
|
|||
SVN inmemory module
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from rhodecode.lib.datelib import date_astimestamp
|
||||
from rhodecode.lib.str_utils import safe_str, safe_bytes
|
||||
from rhodecode.lib.vcs.backends import base
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SubversionInMemoryCommit(base.BaseInMemoryCommit):
|
||||
def commit(self, message, author, parents=None, branch=None, date=None, **kwargs):
|
||||
if branch not in (None, self.repository.DEFAULT_BRANCH_NAME):
|
||||
raise NotImplementedError("Branches are not yet supported")
|
||||
log.debug(
|
||||
"SVN does not support branches in inmemory commits. "
|
||||
"Ignoring branch parameter: %s (treating as default)",
|
||||
branch,
|
||||
)
|
||||
|
||||
self.check_integrity(parents)
|
||||
|
||||
|
|
|
|||
|
|
@ -609,10 +609,6 @@ class UserModel(BaseModel):
|
|||
if detach_artifacts:
|
||||
self._detach_user_artifacts(user.username, user.artifacts, new_owner)
|
||||
|
||||
# Flush all detach operations to database before deleting user
|
||||
# Ensures foreign keys are properly updated and prevents NULL constraint violations
|
||||
self.sa.flush()
|
||||
|
||||
user_data = user.get_dict() # fetch user data before expire
|
||||
|
||||
# we might change the user data with detach/delete, make sure
|
||||
|
|
|
|||
|
|
@ -584,9 +584,12 @@ def test_clone_url_generator(tmpl, repo_name, overrides, prefix, expected):
|
|||
assert clone_url == expected
|
||||
|
||||
|
||||
def test_clone_url_svn_ssh_generator():
|
||||
def test_clone_url_svn_ssh_generator(monkeypatch):
|
||||
from rhodecode.lib.utils2 import get_clone_url
|
||||
|
||||
# Ensure RC_SSH_PORT is not set for this test
|
||||
monkeypatch.delenv("RC_SSH_PORT", raising=False)
|
||||
|
||||
class RequestStub(object):
|
||||
def request_url(self, name):
|
||||
return "http://vps1:8000"
|
||||
|
|
|
|||
|
|
@ -294,6 +294,7 @@ class TestPullRequestModel(object):
|
|||
message=message,
|
||||
use_rebase=False,
|
||||
close_branch=False,
|
||||
squash_commits=False,
|
||||
)
|
||||
self.invalidation_mock.assert_called_once_with(pull_request.target_repo.repo_name)
|
||||
|
||||
|
|
@ -333,6 +334,7 @@ class TestPullRequestModel(object):
|
|||
message=message,
|
||||
use_rebase=False,
|
||||
close_branch=False,
|
||||
squash_commits=False,
|
||||
)
|
||||
self.invalidation_mock.assert_called_once_with(pull_request.target_repo.repo_name)
|
||||
|
||||
|
|
@ -367,6 +369,7 @@ class TestPullRequestModel(object):
|
|||
message=message,
|
||||
use_rebase=False,
|
||||
close_branch=False,
|
||||
squash_commits=False,
|
||||
)
|
||||
|
||||
pull_request = PullRequest.get(pull_request.pull_request_id)
|
||||
|
|
@ -403,7 +406,7 @@ class TestPullRequestModel(object):
|
|||
source_ref="source-ref-dummy",
|
||||
target="target-dummy",
|
||||
)
|
||||
assert type(title) == str
|
||||
assert isinstance(title, str)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"title, has_wip",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue