re-enabling TestSendMailUsingConfigAdvanced (#8836)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
05460ac3a7
Коммит
b6d5cc4f69
@@ -229,7 +229,7 @@ func SendMailUsingConfigAdvanced(mimeTo, smtpTo string, from mail.Address, subje
|
|||||||
}
|
}
|
||||||
|
|
||||||
func SendMail(c *smtp.Client, mimeTo, smtpTo string, from mail.Address, subject, htmlBody string, attachments []*model.FileInfo, mimeHeaders map[string]string, fileBackend FileBackend, date time.Time) *model.AppError {
|
func SendMail(c *smtp.Client, mimeTo, smtpTo string, from mail.Address, subject, htmlBody string, attachments []*model.FileInfo, mimeHeaders map[string]string, fileBackend FileBackend, date time.Time) *model.AppError {
|
||||||
mlog.Debug(fmt.Sprintf("sending mail to %v with subject of '%v'", mimeTo, subject))
|
mlog.Debug(fmt.Sprintf("sending mail to %v with subject of '%v'", smtpTo, subject))
|
||||||
|
|
||||||
htmlMessage := "\r\n<html><body>" + htmlBody + "</body></html>"
|
htmlMessage := "\r\n<html><body>" + htmlBody + "</body></html>"
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,16 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"net/mail"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
|
|
||||||
|
"github.com/mattermost/mattermost-server/model"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -127,8 +132,8 @@ func TestSendMailUsingConfig(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*func TestSendMailUsingConfigAdvanced(t *testing.T) {
|
func TestSendMailUsingConfigAdvanced(t *testing.T) {
|
||||||
cfg, _, err := LoadConfig("config.json")
|
cfg, _, _, err := LoadConfig("config.json")
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
T = GetUserTranslations("en")
|
T = GetUserTranslations("en")
|
||||||
|
|
||||||
@@ -150,9 +155,9 @@ func TestSendMailUsingConfig(t *testing.T) {
|
|||||||
filePath2 := fmt.Sprintf("test2/%s", fileName)
|
filePath2 := fmt.Sprintf("test2/%s", fileName)
|
||||||
fileContents1 := []byte("hello world")
|
fileContents1 := []byte("hello world")
|
||||||
fileContents2 := []byte("foo bar")
|
fileContents2 := []byte("foo bar")
|
||||||
_, err := fileBackend.WriteFile(bytes.NewReader(fileContents1), filePath1)
|
_, err = fileBackend.WriteFile(bytes.NewReader(fileContents1), filePath1)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
_, err := fileBackend.WriteFile(bytes.NewReader(fileContents2), filePath2)
|
_, err = fileBackend.WriteFile(bytes.NewReader(fileContents2), filePath2)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
defer fileBackend.RemoveFile(filePath1)
|
defer fileBackend.RemoveFile(filePath1)
|
||||||
defer fileBackend.RemoveFile(filePath2)
|
defer fileBackend.RemoveFile(filePath2)
|
||||||
@@ -221,7 +226,7 @@ func TestSendMailUsingConfig(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
func TestAuthMethods(t *testing.T) {
|
func TestAuthMethods(t *testing.T) {
|
||||||
auth := &authChooser{
|
auth := &authChooser{
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user