Check license expiration, disable license and notify administrator (#14420)

* Check license expiration and notify administrator
Этот коммит содержится в:
catalintomai
2020-05-06 10:28:49 -07:00
коммит произвёл GitHub
родитель 5ad3eaf7ee
Коммит 58305b080f
9 изменённых файлов: 175 добавлений и 0 удалений

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

@@ -116,6 +116,15 @@ func TestLicenseIsExpired(t *testing.T) {
assert.False(t, l1.IsExpired())
}
func TestLicenseIsPastGracePeriod(t *testing.T) {
l1 := License{}
l1.ExpiresAt = GetMillis() - LICENSE_GRACE_PERIOD - 1000
assert.True(t, l1.IsPastGracePeriod())
l1.ExpiresAt = GetMillis() + 1000
assert.False(t, l1.IsPastGracePeriod())
}
func TestLicenseIsStarted(t *testing.T) {
l1 := License{}
l1.StartsAt = GetMillis() - 1000