Changeset - 8b4c09e740a7
[Not reviewed]
default
0 1 0
FUJIWARA Katsunori - 9 years ago 2017-01-22 18:17:38
foozy@lares.dti.ne.jp
tests: add commit_change() author to specify author name explicitly

This allows creation of revisions with arbitrary "author" information.
1 file changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/fixture.py
Show inline comments
 
@@ -274,11 +274,14 @@ class Fixture(object):
 

	
 
        return source
 

	
 
    def commit_change(self, repo, filename, content, message, vcs_type, parent=None, newfile=False):
 
    def commit_change(self, repo, filename, content, message, vcs_type,
 
                      parent=None, newfile=False, author=None):
 
        repo = Repository.get_by_repo_name(repo)
 
        _cs = parent
 
        if not parent:
 
        if parent is None:
 
            _cs = EmptyChangeset(alias=vcs_type)
 
        if author is None:
 
            author = TEST_USER_ADMIN_LOGIN
 

	
 
        if newfile:
 
            nodes = {
 
@@ -291,13 +294,13 @@ class Fixture(object):
 
                message=message,
 
                nodes=nodes,
 
                parent_cs=_cs,
 
                author=TEST_USER_ADMIN_LOGIN,
 
                author=author,
 
            )
 
        else:
 
            cs = ScmModel().commit_change(
 
                repo=repo.scm_instance, repo_name=repo.repo_name,
 
                cs=parent, user=TEST_USER_ADMIN_LOGIN,
 
                author=TEST_USER_ADMIN_LOGIN,
 
                author=author,
 
                message=message,
 
                content=content,
 
                f_path=filename
0 comments (0 inline, 0 general)