Sfoglia il codice sorgente

delete temp record

master
Patrick Peng Sun 8 anni fa
parent
commit
2f7f89d234
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. +11
    -2
      eventSubscribe_test.go

+ 11
- 2
eventSubscribe_test.go Vedi File



import ( import (
"encoding/json" "encoding/json"
"log"
"testing" "testing"
) )


} }


func TestRegisterNewUser(t *testing.T) { func TestRegisterNewUser(t *testing.T) {
msg := ` msg := `
{ {
"subscribe": 1, "subscribe": 1,
in.header.FromUserName = "abc" in.header.FromUserName = "abc"
s := WechatUserInfo{} s := WechatUserInfo{}
json.Unmarshal([]byte(msg), &s) json.Unmarshal([]byte(msg), &s)
s.registerNewUserWithInfo(in)
newuser, err := s.registerNewUserWithInfo(in)
AssertEqual(t, err, nil, "should be successfully added new user")
AssertEqual(t, newuser.WechatHitxyID, in.header.FromUserName, "wechat_hitxy_id mismatch")
log.Printf("created temp Lead %s ", newuser.ID)

deleted, err := crmDeleteEntity("Lead", newuser.ID)
AssertEqual(t, err, nil, "should be successfully cleanup test record")
AssertEqual(t, deleted, true, "deleted should be true ")
log.Printf("deleted temp Lead %s ", newuser.ID)
} }

Loading…
Annulla
Salva