48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
|
package tests
|
|||
|
|
|||
|
import (
|
|||
|
"github.com/stretchr/testify/assert"
|
|||
|
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
|
|||
|
"penahub.gitlab.yandexcloud.net/backend/quiz/worker.git/senders"
|
|||
|
"testing"
|
|||
|
"time"
|
|||
|
)
|
|||
|
|
|||
|
func Test_Tg_Sender(t *testing.T) {
|
|||
|
tg_Sender, err := senders.NewTgSender("6712573453:AAFbioUuXf0Te73MUCqa0_h09qEQ1iQREas")
|
|||
|
assert.NoError(t, err)
|
|||
|
err = tg_Sender.SendLead(senders.LeadData{
|
|||
|
To: int64(542073142),
|
|||
|
Subject: "test_TG_Sender",
|
|||
|
TemplateData: senders.TemplateData{
|
|||
|
QuizConfig: model.ResultInfo{
|
|||
|
Theme: "Taemplste Quiz",
|
|||
|
},
|
|||
|
AnswerContent: model.ResultContent{
|
|||
|
Name: "Pasha",
|
|||
|
Phone: "+723456789",
|
|||
|
Email: "test@example.com",
|
|||
|
//Adress: "chtoto tam",
|
|||
|
Telegram: "@test",
|
|||
|
Wechat: "test_wechat",
|
|||
|
Viber: "+723456789",
|
|||
|
Vk: "test_vk",
|
|||
|
Skype: "test_skype",
|
|||
|
Whatsup: "test_whatsup",
|
|||
|
Messenger: "test_messenger",
|
|||
|
},
|
|||
|
AllAnswers: []model.ResultAnswer{
|
|||
|
{AnswerID: 1, QuestionID: 1, Content: "Pasha", CreatedAt: time.Now()},
|
|||
|
{AnswerID: 2, QuestionID: 2, Content: "From a friend", CreatedAt: time.Now()},
|
|||
|
},
|
|||
|
QuestionsMap: map[uint64]string{
|
|||
|
1: "How did you hear about us?",
|
|||
|
2: "How did you hear about us?",
|
|||
|
},
|
|||
|
AnswerTime: time.Now().Format("Monday, 2 January 2006 г., 15:04 UTC-07:00"),
|
|||
|
},
|
|||
|
})
|
|||
|
|
|||
|
assert.NoError(t, err)
|
|||
|
}
|