Example #1
0
func GenerateRandomUser() *auth.User {
	email := fmt.Sprintf("test+%[email protected]", RandId(12))
	user := &auth.User{
		Email:  email,
		Scrypt: []byte{0},
		Salt:   []byte{0},
	}
	_, err := auth.SaveUser(user)
	if err != nil {
		panic(err)
	}
	return user
}
Example #2
0
func generateRandomUsers() []*auth.User {
	Info("Inserting random users")
	users := []*auth.User{}
	for i := 0; i < 1000; i++ {
		email := fmt.Sprintf("test+%[email protected]", i)
		user := auth.LoadUserByEmail(email)
		if user == nil {
			user = &auth.User{
				Email:  email,
				Scrypt: []byte{0},
				Salt:   []byte{0},
			}
			_, err := auth.SaveUser(user)
			if err != nil {
				panic(err)
			}
		}
		users = append(users, user)
	}
	Info("Done inserting random users")
	return users
}