# HG changeset patch # User FUJIWARA Katsunori # Date 1485105458 -32400 # Node ID 8b4c09e740a746601635ec4e96738e4f30041c77 # Parent 8377f2bfb88f3a7b6d1dba768666e6b17eb4022b tests: add commit_change() author to specify author name explicitly This allows creation of revisions with arbitrary "author" information. diff -r 8377f2bfb88f -r 8b4c09e740a7 kallithea/tests/fixture.py --- a/kallithea/tests/fixture.py Mon Jan 23 01:56:39 2017 +0100 +++ b/kallithea/tests/fixture.py Mon Jan 23 02:17:38 2017 +0900 @@ -274,11 +274,14 @@ 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 @@ 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