@@ -85,7 +85,7 @@ func TestComposeIssueCommentMessage(t *testing.T) {
85
85
86
86
recipients := []
* user_model.
User {{
Name :
"Test" ,
Email :
"[email protected] " }, {
Name :
"Test2" ,
Email :
"[email protected] " }}
87
87
msgs , err := composeIssueCommentMessages (& mailCommentContext {
88
- Context : context .TODO (), // TODO: use a correct context
88
+ Context : context .TODO (),
89
89
Issue : issue , Doer : doer , ActionType : activities_model .ActionCommentIssue ,
90
90
Content : fmt .Sprintf ("test @%s %s#%d body" , doer .Name , issue .Repo .FullName (), issue .Index ),
91
91
Comment : comment ,
@@ -131,7 +131,7 @@ func TestComposeIssueMessage(t *testing.T) {
131
131
132
132
recipients := []
* user_model.
User {{
Name :
"Test" ,
Email :
"[email protected] " }, {
Name :
"Test2" ,
Email :
"[email protected] " }}
133
133
msgs , err := composeIssueCommentMessages (& mailCommentContext {
134
- Context : context .TODO (), // TODO: use a correct context
134
+ Context : context .TODO (),
135
135
Issue : issue , Doer : doer , ActionType : activities_model .ActionCreateIssue ,
136
136
Content : "test body" ,
137
137
}, "en-US" , recipients , false , "issue create" )
@@ -178,14 +178,14 @@ func TestTemplateSelection(t *testing.T) {
178
178
}
179
179
180
180
msg := testComposeIssueCommentMessage (t , & mailCommentContext {
181
- Context : context .TODO (), // TODO: use a correct context
181
+ Context : context .TODO (),
182
182
Issue : issue , Doer : doer , ActionType : activities_model .ActionCreateIssue ,
183
183
Content : "test body" ,
184
184
}, recipients , false , "TestTemplateSelection" )
185
185
expect (t , msg , "issue/new/subject" , "issue/new/body" )
186
186
187
187
msg = testComposeIssueCommentMessage (t , & mailCommentContext {
188
- Context : context .TODO (), // TODO: use a correct context
188
+ Context : context .TODO (),
189
189
Issue : issue , Doer : doer , ActionType : activities_model .ActionCommentIssue ,
190
190
Content : "test body" , Comment : comment ,
191
191
}, recipients , false , "TestTemplateSelection" )
@@ -194,14 +194,14 @@ func TestTemplateSelection(t *testing.T) {
194
194
pull := unittest .AssertExistsAndLoadBean (t , & issues_model.Issue {ID : 2 , Repo : repo , Poster : doer })
195
195
comment = unittest .AssertExistsAndLoadBean (t , & issues_model.Comment {ID : 4 , Issue : pull })
196
196
msg = testComposeIssueCommentMessage (t , & mailCommentContext {
197
- Context : context .TODO (), // TODO: use a correct context
197
+ Context : context .TODO (),
198
198
Issue : pull , Doer : doer , ActionType : activities_model .ActionCommentPull ,
199
199
Content : "test body" , Comment : comment ,
200
200
}, recipients , false , "TestTemplateSelection" )
201
201
expect (t , msg , "pull/comment/subject" , "pull/comment/body" )
202
202
203
203
msg = testComposeIssueCommentMessage (t , & mailCommentContext {
204
- Context : context .TODO (), // TODO: use a correct context
204
+ Context : context .TODO (),
205
205
Issue : issue , Doer : doer , ActionType : activities_model .ActionCloseIssue ,
206
206
Content : "test body" , Comment : comment ,
207
207
}, recipients , false , "TestTemplateSelection" )
@@ -220,7 +220,7 @@ func TestTemplateServices(t *testing.T) {
220
220
221
221
recipients := []
* user_model.
User {{
Name :
"Test" ,
Email :
"[email protected] " }}
222
222
msg := testComposeIssueCommentMessage (t , & mailCommentContext {
223
- Context : context .TODO (), // TODO: use a correct context
223
+ Context : context .TODO (),
224
224
Issue : issue , Doer : doer , ActionType : actionType ,
225
225
Content : "test body" , Comment : comment ,
226
226
}, recipients , fromMention , "TestTemplateServices" )
@@ -263,7 +263,7 @@ func testComposeIssueCommentMessage(t *testing.T, ctx *mailCommentContext, recip
263
263
func TestGenerateAdditionalHeaders (t * testing.T ) {
264
264
doer , _ , issue , _ := prepareMailerTest (t )
265
265
266
- ctx := & mailCommentContext {Context : context .TODO () /* TODO: use a correct context */ , Issue : issue , Doer : doer }
266
+ ctx := & mailCommentContext {Context : context .TODO (), Issue : issue , Doer : doer }
267
267
recipient := & user_model.
User {
Name :
"test" ,
Email :
"[email protected] " }
268
268
269
269
headers := generateAdditionalHeaders (ctx , "dummy-reason" , recipient )
0 commit comments