github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/model/initial_load_test.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 package model 5 6 import ( 7 "github.com/stretchr/testify/require" 8 "strings" 9 "testing" 10 ) 11 12 func TestInitialLoadJson(t *testing.T) { 13 u := &User{Id: NewId()} 14 o := InitialLoad{User: u} 15 json := o.ToJson() 16 ro := InitialLoadFromJson(strings.NewReader(json)) 17 18 require.Equal(t, o.User.Id, ro.User.Id, "Ids do not match") 19 }