From 51bd710ecdca6628461c9fa2679737073e4d5059 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 14 May 2018 15:59:04 +0100 Subject: MM-9728: Online migration for advanced permissions phase 2 (#8744) * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work. --- api4/team_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'api4/team_test.go') diff --git a/api4/team_test.go b/api4/team_test.go index 6df56f754..45d8e8f08 100644 --- a/api4/team_test.go +++ b/api4/team_test.go @@ -2059,6 +2059,17 @@ func TestUpdateTeamScheme(t *testing.T) { th.App.SetLicense(model.NewTestLicense("")) + // Mark the migration as done. + <-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2) + res := <-th.App.Srv.Store.System().Save(&model.System{Name: model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2, Value: "true"}) + assert.Nil(t, res.Err) + + // Un-mark the migration at the end of the test. + defer func() { + res := <-th.App.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2) + assert.Nil(t, res.Err) + }() + team := &model.Team{ DisplayName: "Name", Description: "Some description", -- cgit v1.2.3-1-g7c22