MM-21898 - Part 1: Generate and use an interface instead of *A… (#13840)

* Generate and use an interface instead of *App
Этот коммит содержится в:
Eli Yukelzon
2020-02-13 13:26:58 +01:00
коммит произвёл GitHub
родитель 66fc096768
Коммит 17523fa5d9
200 изменённых файлов: 4553 добавлений и 2361 удалений

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

@@ -112,7 +112,7 @@ func TestEnsureInstallationDate(t *testing.T) {
for _, tc := range tt {
t.Run(tc.Name, func(t *testing.T) {
sqlStore := th.App.Srv.Store.User().(*sqlstore.SqlUserStore)
sqlStore := th.App.Srv().Store.User().(*sqlstore.SqlUserStore)
sqlStore.GetMaster().Exec("DELETE FROM Users")
for _, createAt := range tc.UsersCreationDates {
@@ -122,9 +122,9 @@ func TestEnsureInstallationDate(t *testing.T) {
}
if tc.PrevInstallationDate == nil {
th.App.Srv.Store.System().PermanentDeleteByName(model.SYSTEM_INSTALLATION_DATE_KEY)
th.App.Srv().Store.System().PermanentDeleteByName(model.SYSTEM_INSTALLATION_DATE_KEY)
} else {
th.App.Srv.Store.System().SaveOrUpdate(&model.System{
th.App.Srv().Store.System().SaveOrUpdate(&model.System{
Name: model.SYSTEM_INSTALLATION_DATE_KEY,
Value: strconv.FormatInt(*tc.PrevInstallationDate, 10),
})
@@ -137,7 +137,7 @@ func TestEnsureInstallationDate(t *testing.T) {
} else {
assert.NoError(t, err)
data, err := th.App.Srv.Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
data, err := th.App.Srv().Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
assert.Nil(t, err)
value, _ := strconv.ParseInt(data.Value, 10, 64)
assert.True(t, *tc.ExpectedInstallationDate <= value && *tc.ExpectedInstallationDate+1000 >= value)