cp_test.go 812 Bytes
Newer Older
hujiebin's avatar
hujiebin committed
1 2 3
package test

import (
hujiebin's avatar
hujiebin committed
4
	"git.hilo.cn/hilo-common/_const/enum/timezone_e"
hujiebin's avatar
hujiebin committed
5 6 7
	"git.hilo.cn/hilo-common/domain"
	"hilo-user/domain/model/cp_m"
	"testing"
hujiebin's avatar
hujiebin committed
8
	"time"
hujiebin's avatar
hujiebin committed
9 10 11 12 13 14 15 16 17 18
)

func TestInitCpAnniversary(t *testing.T) {
	err := cp_m.InitCpAnniversary(domain.CreateModelNil(), cp_m.CpRelation{
		Id:      1,
		UserId1: 7642,
		UserId2: 4549,
	}, "ar")
	println(err)
}
hujiebin's avatar
hujiebin committed
19 20

func TestCalcNextAnniversary(t *testing.T) {
hujiebin's avatar
hujiebin committed
21
	t2 := cp_m.CalcNextAnniversary(1686211996, time.Local)
hujiebin's avatar
hujiebin committed
22 23
	println(t2)
}
hujiebin's avatar
hujiebin committed
24 25 26 27 28 29 30 31 32

func TestCalLoc(t *testing.T) {
	loc := timezone_e.GetFixedTimezone("GMT+8")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
	loc = timezone_e.GetFixedTimezone("GMT+3")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
	loc = timezone_e.GetFixedTimezone("GMT+5")
	println(time.Now().In(loc).Format("2006-01-02 15:04:05"))
}