github.com/hahmadia/mattermost-server@v5.11.1+incompatible/model/permission_test.go (about)

     1  package model
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  // This is a test to ensure that we don't accidentally add more permissions than can fit
    10  // in the database column for role permissions.
    11  func TestPermissionsLength(t *testing.T) {
    12  	permissionsString := ""
    13  	for _, permission := range ALL_PERMISSIONS {
    14  		permissionsString += " " + permission.Id
    15  	}
    16  
    17  	assert.True(t, len(permissionsString) < 4096)
    18  }