1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-05 13:15:11 +02:00

fix: test failed on other timezone.(#3181) (#3183)

This commit is contained in:
kvii 2024-02-02 10:38:20 +08:00 committed by GitHub
parent a556a2b531
commit d9f390cdbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"encoding/base64"
"reflect"
"testing"
"time"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
@ -86,6 +87,10 @@ func TestFormCodecUnmarshal(t *testing.T) {
}
func TestProtoEncodeDecode(t *testing.T) {
loc := time.Local
time.Local = time.UTC
t.Cleanup(func() { time.Local = loc })
in := &complex.Complex{
Id: 2233,
NoOne: "2233",

View File

@ -2,6 +2,7 @@ package form
import (
"testing"
"time"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
@ -12,6 +13,10 @@ import (
)
func TestEncodeValues(t *testing.T) {
loc := time.Local
time.Local = time.UTC
t.Cleanup(func() { time.Local = loc })
in := &complex.Complex{
Id: 2233,
NoOne: "2233",