"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "models/issue_milestone_test.go" between
gitea-1.9.3.tar.gz and gitea-1.9.4.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

issue_milestone_test.go  (gitea-1.9.3):issue_milestone_test.go  (gitea-1.9.4)
skipping to change at line 234 skipping to change at line 234
assert.NoError(t, ChangeMilestoneStatus(milestone, true)) assert.NoError(t, ChangeMilestoneStatus(milestone, true))
AssertExistsAndLoadBean(t, &Milestone{ID: 1}, "is_closed=1") AssertExistsAndLoadBean(t, &Milestone{ID: 1}, "is_closed=1")
CheckConsistencyFor(t, &Repository{ID: milestone.RepoID}, &Milestone{}) CheckConsistencyFor(t, &Repository{ID: milestone.RepoID}, &Milestone{})
assert.NoError(t, ChangeMilestoneStatus(milestone, false)) assert.NoError(t, ChangeMilestoneStatus(milestone, false))
AssertExistsAndLoadBean(t, &Milestone{ID: 1}, "is_closed=0") AssertExistsAndLoadBean(t, &Milestone{ID: 1}, "is_closed=0")
CheckConsistencyFor(t, &Repository{ID: milestone.RepoID}, &Milestone{}) CheckConsistencyFor(t, &Repository{ID: milestone.RepoID}, &Milestone{})
} }
func TestChangeMilestoneIssueStats(t *testing.T) { func TestUpdateMilestoneClosedNum(t *testing.T) {
assert.NoError(t, PrepareTestDatabase()) assert.NoError(t, PrepareTestDatabase())
issue := AssertExistsAndLoadBean(t, &Issue{MilestoneID: 1}, issue := AssertExistsAndLoadBean(t, &Issue{MilestoneID: 1},
"is_closed=0").(*Issue) "is_closed=0").(*Issue)
issue.IsClosed = true issue.IsClosed = true
issue.ClosedUnix = util.TimeStampNow() issue.ClosedUnix = util.TimeStampNow()
_, err := x.Cols("is_closed", "closed_unix").Update(issue) _, err := x.Cols("is_closed", "closed_unix").Update(issue)
assert.NoError(t, err) assert.NoError(t, err)
assert.NoError(t, changeMilestoneIssueStats(x.NewSession(), issue)) assert.NoError(t, updateMilestoneClosedNum(x, issue.MilestoneID))
CheckConsistencyFor(t, &Milestone{}) CheckConsistencyFor(t, &Milestone{})
issue.IsClosed = false issue.IsClosed = false
issue.ClosedUnix = 0 issue.ClosedUnix = 0
_, err = x.Cols("is_closed", "closed_unix").Update(issue) _, err = x.Cols("is_closed", "closed_unix").Update(issue)
assert.NoError(t, err) assert.NoError(t, err)
assert.NoError(t, changeMilestoneIssueStats(x.NewSession(), issue)) assert.NoError(t, updateMilestoneClosedNum(x, issue.MilestoneID))
CheckConsistencyFor(t, &Milestone{}) CheckConsistencyFor(t, &Milestone{})
} }
func TestChangeMilestoneAssign(t *testing.T) { func TestChangeMilestoneAssign(t *testing.T) {
assert.NoError(t, PrepareTestDatabase()) assert.NoError(t, PrepareTestDatabase())
issue := AssertExistsAndLoadBean(t, &Issue{RepoID: 1}).(*Issue) issue := AssertExistsAndLoadBean(t, &Issue{RepoID: 1}).(*Issue)
doer := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User) doer := AssertExistsAndLoadBean(t, &User{ID: 2}).(*User)
assert.NotNil(t, issue) assert.NotNil(t, issue)
assert.NotNil(t, doer) assert.NotNil(t, doer)
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)