fix: stabilize backend tests

This commit is contained in:
2026-01-08 14:07:58 +08:00
parent 7f1d2e7cb3
commit edbb62449b
18 changed files with 281 additions and 147 deletions

View File

@@ -139,10 +139,11 @@ func (s *CreatorTestSuite) Test_UpdateContent() {
Create(&models.ContentPrice{TenantID: t.ID, UserID: u.ID, ContentID: c.ID, PriceAmount: 100})
Convey("should update content", func() {
price := 20.00
form := &creator_dto.ContentUpdateForm{
Title: "New Title",
Genre: "video",
Price: 20.00,
Price: &price,
}
err := Creator.UpdateContent(ctx, u.ID, c.ID, form)
So(err, ShouldBeNil)
@@ -260,7 +261,7 @@ func (s *CreatorTestSuite) Test_Withdraw() {
models.TableNameTenantLedger,
)
u := &models.User{Username: "creator6", Phone: "13700000006", Balance: 5000} // 50.00
u := &models.User{Username: "creator6", Phone: "13700000006", Balance: 5000, IsRealNameVerified: true} // 50.00
models.UserQuery.WithContext(ctx).Create(u)
ctx = context.WithValue(ctx, consts.CtxKeyUser, u.ID)