diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-03-13 08:26:23 -0400 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-13 12:26:23 +0000 |
commit | 3559fb7959cf008b038239f2e7c43e604c44cd31 (patch) | |
tree | 159fdbb16a169926e0d142aa17d6086fcded62c4 /api4/apitestlib.go | |
parent | fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81 (diff) | |
download | chat-3559fb7959cf008b038239f2e7c43e604c44cd31.tar.gz chat-3559fb7959cf008b038239f2e7c43e604c44cd31.tar.bz2 chat-3559fb7959cf008b038239f2e7c43e604c44cd31.zip |
Implement SAML endpoints for APIv4 (#5671)
* Implement SAML endpoints for APIv4
* Fix unit test
* Only disable encryption when removing puplic/private certs
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r-- | api4/apitestlib.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go index 3d2feaf6e..30dbfadae 100644 --- a/api4/apitestlib.go +++ b/api4/apitestlib.go @@ -38,6 +38,37 @@ type TestHelper struct { SystemAdminUser *model.User } +func SetupEnterprise() *TestHelper { + if app.Srv == nil { + utils.TranslationsPreInit() + utils.LoadConfig("config.json") + utils.InitTranslations(utils.Cfg.LocalizationSettings) + utils.Cfg.TeamSettings.MaxUsersPerTeam = 50 + *utils.Cfg.RateLimitSettings.Enable = false + utils.Cfg.EmailSettings.SendEmailNotifications = true + utils.Cfg.EmailSettings.SMTPServer = "dockerhost" + utils.Cfg.EmailSettings.SMTPPort = "2500" + utils.Cfg.EmailSettings.FeedbackEmail = "test@example.com" + utils.DisableDebugLogForTest() + utils.License.Features.SetDefaults() + app.NewServer() + app.InitStores() + InitRouter() + app.StartServer() + utils.InitHTML() + InitApi(true) + utils.EnableDebugLogForTest() + app.Srv.Store.MarkSystemRanUnitTests() + + *utils.Cfg.TeamSettings.EnableOpenServer = true + } + + th := &TestHelper{} + th.Client = th.CreateClient() + th.SystemAdminClient = th.CreateClient() + return th +} + func Setup() *TestHelper { if app.Srv == nil { utils.TranslationsPreInit() |