2022-09-28 09:01:17 +02:00
|
|
|
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) {
|
2022-10-02 11:38:30 +02:00
|
|
|
s := New(config.TestConfig())
|
2022-09-28 09:01:17 +02:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2022-09-30 00:42:19 +02:00
|
|
|
t.Logf("Public Session: %#v", sess)
|
2022-09-28 09:01:17 +02:00
|
|
|
}
|