photoprism/internal/entity/file_test.go
Michael Mayer 4e06deda76 Backend: Rename "models" package to "entity"
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
2019-12-11 16:55:18 +01:00

18 lines
400 B
Go

package entity
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestFile_DownloadFileName(t *testing.T) {
photo := &Photo{TakenAt: time.Date(2019, 01, 15, 0, 0, 0, 0, time.UTC), PhotoTitle: "Berlin / Morning Mood"}
file := &File{Photo: photo, FileType: "jpg"}
filename := file.DownloadFileName()
assert.Equal(t, "20190115-000000-Berlin-Morning-Mood.jpg", filename)
}