package models import ( "fmt" check "gopkg.in/check.v1" ) func (s *ModelsSuite) TestSMTPGetDialer(ch *check.C) { host := "localhost" port := 25 smtp := SMTP{ Host: fmt.Sprintf("%s:%d", host, port), IgnoreCertErrors: false, } d, err := smtp.GetDialer() ch.Assert(err, check.Equals, nil) dialer := d.(*Dialer).Dialer ch.Assert(dialer.Host, check.Equals, host) ch.Assert(dialer.Port, check.Equals, port) ch.Assert(dialer.TLSConfig.ServerName, check.Equals, smtp.Host) ch.Assert(dialer.TLSConfig.InsecureSkipVerify, check.Equals, smtp.IgnoreCertErrors) }