PLT-6113 Added initial unit tests for cmd package (#6086)

* Fixed app.CreateUser not using the provided locale

* Added initial unit tests for cmd package

* Disabled unit tests while we move to 'go build'
This commit is contained in:
Harrison Healey
2017-04-15 13:45:22 -04:00
committed by Christopher Speller
parent 24667e3e54
commit 461a0b3b7c
10 changed files with 525 additions and 20 deletions

View File

@@ -75,6 +75,14 @@ func (me *TestHelper) InitBasic() *TestHelper {
return me
}
func (me *TestHelper) MakeUsername() string {
return "un_" + model.NewId()
}
func (me *TestHelper) MakeEmail() string {
return "success_" + model.NewId() + "@simulator.amazonses.com"
}
func (me *TestHelper) CreateTeam() *model.Team {
id := model.NewId()
team := &model.Team{

View File

@@ -186,7 +186,9 @@ func CreateUser(user *model.User) (*model.User, *model.AppError) {
}
}
user.Locale = *utils.Cfg.LocalizationSettings.DefaultClientLocale
if _, ok := utils.GetSupportedLocales()[user.Locale]; !ok {
user.Locale = *utils.Cfg.LocalizationSettings.DefaultClientLocale
}
if ruser, err := createUser(user); err != nil {
return nil, err