# HG changeset patch # User Manuel Jacob # Date 1680087692 -7200 # Node ID 6cb54b9ef4de6c5ce269777688fc1abb8636539f # Parent a136383459ef8a8b1938d5282b379138b8480773 api: include creation date in comments diff -r a136383459ef -r 6cb54b9ef4de kallithea/model/db.py --- a/kallithea/model/db.py Wed Mar 29 11:59:07 2023 +0200 +++ b/kallithea/model/db.py Wed Mar 29 13:01:32 2023 +0200 @@ -1914,6 +1914,7 @@ return dict( comment_id=self.comment_id, username=self.author.username, + created_on=self.created_on.replace(microsecond=0), text=self.text, ) diff -r a136383459ef -r 6cb54b9ef4de kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py Wed Mar 29 11:59:07 2023 +0200 +++ b/kallithea/tests/api/api_base.py Wed Mar 29 13:01:32 2023 +0200 @@ -2517,6 +2517,7 @@ 'comment_id': commentobj.comment_id, 'text': 'example changeset comment', 'username': 'test_admin', + 'created_on': commentobj.created_on.replace(microsecond=0).isoformat(), } assert comment == expected @@ -2537,6 +2538,7 @@ 'comment_id': commentobj.comment_id, 'text': 'example inline comment', 'username': 'test_admin', + 'created_on': commentobj.created_on.replace(microsecond=0).isoformat(), }] }] ] @@ -2584,7 +2586,8 @@ "org_ref_parts": ["branch", "stable", self.TEST_PR_SRC], "other_ref_parts": ["branch", "default", self.TEST_PR_DST], "comments": [{"username": base.TEST_USER_ADMIN_LOGIN, "text": "", - "comment_id": pullrequest.comments[0].comment_id}], + "comment_id": pullrequest.comments[0].comment_id, + "created_on": "2000-01-01T00:00:00"}], "owner": base.TEST_USER_ADMIN_LOGIN, "statuses": [{"status": "under_review", "reviewer": base.TEST_USER_ADMIN_LOGIN, "modified_at": "2000-01-01T00:00:00"} for i in range(0, len(self.TEST_PR_REVISIONS))], "title": "get test",