mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 09:55:20 +02:00
more context for models (#19511)
make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
This commit is contained in:
parent
332b2ecd21
commit
06e4687cec
54 changed files with 275 additions and 245 deletions
|
@ -369,7 +369,12 @@ func TestDeleteIssueLabel(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
assert.NoError(t, DeleteIssueLabel(issue, label, doer))
|
||||
ctx, committer, err := db.TxContext()
|
||||
defer committer.Close()
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, DeleteIssueLabel(ctx, issue, label, doer))
|
||||
assert.NoError(t, committer.Commit())
|
||||
|
||||
unittest.AssertNotExistsBean(t, &IssueLabel{IssueID: issueID, LabelID: labelID})
|
||||
unittest.AssertExistsAndLoadBean(t, &Comment{
|
||||
Type: CommentTypeLabel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue