Add inbucket docker image to allow local and automated testing of emails (#4901)

* add docker container for inbucket

* Add way to get the emails using inbucket and add a test for reset password

* add config setting to send emails

* update TestEmailTest

update

* add another test and fix wrong assert

* update per review

fix lint

change senders email

* Revert config.json to default values for EmailSettings section

* update test

* add setup to make the test run
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-01-17 15:01:41 +01:00
коммит произвёл Harrison Healey
родитель 97a51b0e31
Коммит dc54e640c2
9 изменённых файлов: 218 добавлений и 6 удалений

Просмотреть файл

@@ -160,6 +160,22 @@ func TestRecycleDatabaseConnection(t *testing.T) {
func TestEmailTest(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
SendEmailNotifications := utils.Cfg.EmailSettings.SendEmailNotifications
SMTPServer := utils.Cfg.EmailSettings.SMTPServer
SMTPPort := utils.Cfg.EmailSettings.SMTPPort
FeedbackEmail := utils.Cfg.EmailSettings.FeedbackEmail
defer func() {
utils.Cfg.EmailSettings.SendEmailNotifications = SendEmailNotifications
utils.Cfg.EmailSettings.SMTPServer = SMTPServer
utils.Cfg.EmailSettings.SMTPPort = SMTPPort
utils.Cfg.EmailSettings.FeedbackEmail = FeedbackEmail
}()
utils.Cfg.EmailSettings.SendEmailNotifications = false
utils.Cfg.EmailSettings.SMTPServer = ""
utils.Cfg.EmailSettings.SMTPPort = ""
utils.Cfg.EmailSettings.FeedbackEmail = ""
if _, err := th.BasicClient.TestEmail(utils.Cfg); err == nil {
t.Fatal("Shouldn't have permissions")
}