account_test.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/dm/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestReduceMoral(t *testing.T) {
  9. arg := &model.ReduceMoral{
  10. UID: 150781,
  11. Moral: -1,
  12. Origin: 2,
  13. Reason: 1,
  14. ReasonType: 1,
  15. Operator: "zhang",
  16. IsNotify: 1,
  17. Remark: "dm admin test",
  18. }
  19. Convey("", t, func() {
  20. err := testDao.ReduceMoral(context.TODO(), arg)
  21. So(err, ShouldBeNil)
  22. })
  23. }
  24. func TestBlockUser1(t *testing.T) {
  25. arg := &model.BlockUser{
  26. UID: 150781,
  27. BlockForever: 1,
  28. BlockTimeLength: 0,
  29. BlockRemark: model.BlockReason[5],
  30. ReasonType: 5,
  31. Operator: "zhang",
  32. OriginType: 2,
  33. Moral: 10,
  34. OriginURL: "aaaaa",
  35. OriginContent: "test delete1",
  36. OriginTitle: "test title",
  37. IsNotify: 0,
  38. }
  39. Convey("", t, func() {
  40. err := testDao.BlockUser(context.TODO(), arg)
  41. So(err, ShouldBeNil)
  42. })
  43. }
  44. func TestBlockUser2(t *testing.T) {
  45. arg := &model.BlockUser{
  46. UID: 150781,
  47. BlockForever: 0,
  48. BlockTimeLength: 5,
  49. BlockRemark: model.BlockReason[5],
  50. ReasonType: 5,
  51. Operator: "zhang",
  52. OriginType: 2,
  53. Moral: 10,
  54. OriginURL: "aaaaa",
  55. OriginContent: "test delete2",
  56. OriginTitle: "test title",
  57. IsNotify: 0,
  58. }
  59. Convey("", t, func() {
  60. err := testDao.BlockUser(context.TODO(), arg)
  61. So(err, ShouldBeNil)
  62. })
  63. }