Cache test users to speed up testing (#13741)

* Cache test users to speed up testing

Users were recreated for many tests and hashing passwords takes a lot of
time. Testing /api4 takes around 120s less and /app 60s less.

* fix build

* simplifying a bit the approach

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
Patryk Pomykalski
2020-03-03 14:19:54 +01:00
коммит произвёл GitHub
родитель 89f4e9d7ef
Коммит 662eef6881
4 изменённых файлов: 78 добавлений и 13 удалений

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

@@ -1242,6 +1242,10 @@ func TestAutocompleteUsers(t *testing.T) {
func TestGetProfileImage(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
// recreate basic user
th.BasicUser = th.CreateUser()
th.LoginBasic()
user := th.BasicUser
data, resp := th.Client.GetProfileImage(user.Id, "")