photoprism/internal/session/session_public_test.go
Michael Mayer 323d495840 Auth: Apply user rights and permissions in the search API #98 #782
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-09-30 00:42:19 +02:00

22 lines
473 B
Go

package session
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/pkg/clean"
)
func TestSession_Public(t *testing.T) {
s := New(ExpiresAfter, config.TestConfig())
sess := s.Public()
assert.NotNil(t, sess)
assert.Truef(t, s.Exists(sess.ID), "session %s should exist", clean.LogQuote(sess.ID))
assert.Equal(t, PublicID, sess.ID)
t.Logf("Public Session: %#v", sess)
}