The backend for the AiteStory website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
559 B

package model
import "testing"
import "time"
func TestPage(t *testing.T) {
t.Run("BasicConstants", func(t *testing.T) {
if PageMinDate.Format(time.RFC3339) != "1753-01-01T00:00:00Z" {
t.Error("Invalid date:", PageMinDate.Format(time.RFC3339))
t.Fail()
}
page := Page{}
page.generateID()
if len(page.ID) != 16 {
t.Errorf("len(page.ID): %d != 16", len(page.ID))
t.Fail()
}
id1 := page.ID
page.generateID()
id2 := page.ID
t.Logf("Page IDs: %s, %s (should not be the same)", id1, id2)
if id1 == id2 {
t.Fail()
}
})
}