mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Backport #25639 by @lunny Fix #25257 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -45,11 +45,12 @@ func TestAPIGetCommentAttachment(t *testing.T) {
 | 
			
		||||
	var apiAttachment api.Attachment
 | 
			
		||||
	DecodeJSON(t, resp, &apiAttachment)
 | 
			
		||||
 | 
			
		||||
	expect := convert.ToAttachment(attachment)
 | 
			
		||||
	expect := convert.ToAPIAttachment(repo, attachment)
 | 
			
		||||
	assert.Equal(t, expect.ID, apiAttachment.ID)
 | 
			
		||||
	assert.Equal(t, expect.Name, apiAttachment.Name)
 | 
			
		||||
	assert.Equal(t, expect.UUID, apiAttachment.UUID)
 | 
			
		||||
	assert.Equal(t, expect.Created.Unix(), apiAttachment.Created.Unix())
 | 
			
		||||
	assert.Equal(t, expect.DownloadURL, apiAttachment.DownloadURL)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestAPIListCommentAttachments(t *testing.T) {
 | 
			
		||||
 
 | 
			
		||||
@@ -128,7 +128,7 @@ func TestAPIGetComment(t *testing.T) {
 | 
			
		||||
	DecodeJSON(t, resp, &apiComment)
 | 
			
		||||
 | 
			
		||||
	assert.NoError(t, comment.LoadPoster(db.DefaultContext))
 | 
			
		||||
	expect := convert.ToComment(db.DefaultContext, comment)
 | 
			
		||||
	expect := convert.ToAPIComment(db.DefaultContext, repo, comment)
 | 
			
		||||
 | 
			
		||||
	assert.Equal(t, expect.ID, apiComment.ID)
 | 
			
		||||
	assert.Equal(t, expect.Poster.FullName, apiComment.Poster.FullName)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user