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 @@ -1201,9 +1201,10 @@ class TestGetSubmoduleUrl(object): def test_submodules_file_found(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1215,9 +1216,10 @@ class TestGetSubmoduleUrl(object): def test_complex_submodule_path(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "complex/subrepo/path"]\n' '\tpath = complex/subrepo/path\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1236,9 +1238,10 @@ class TestGetSubmoduleUrl(object): def test_path_not_found(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n' @@ -1250,9 +1253,10 @@ class TestGetSubmoduleUrl(object): def test_returns_cached_values(self): commit = GitCommit(repository=mock.Mock(), raw_id='abcdef12', idx=1) node = mock.Mock() + with mock.patch.object( commit, 'get_node', return_value=node) as get_node_mock: - node.content = ( + node.str_content = ( '[submodule "subrepo1"]\n' '\tpath = subrepo1\n' '\turl = https://code.rhodecode.com/dulwich\n'