mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 19:53:21 +02:00
Improved Article model
This commit is contained in:
@@ -9,18 +9,18 @@ import (
|
||||
)
|
||||
|
||||
var Article1, _ = bson.Marshal(Article{
|
||||
IdName: "test_article_1",
|
||||
TitleID: "test_article_1",
|
||||
Date: 1671482492,
|
||||
Content: gin.H{},
|
||||
PageID: "blog",
|
||||
Tags: []string{"blog"},
|
||||
Online: false,
|
||||
})
|
||||
|
||||
var Article2, _ = bson.Marshal(Article{
|
||||
IdName: "test_article_2",
|
||||
TitleID: "test_article_2",
|
||||
Date: 1671899112,
|
||||
Content: gin.H{},
|
||||
PageID: "blog",
|
||||
Tags: []string{"blog"},
|
||||
Online: false,
|
||||
})
|
||||
|
||||
@@ -30,8 +30,8 @@ func TestGetAllArticlesBusiness(t *testing.T) {
|
||||
documents := GetAllArticlesBusiness(BSONConvertedArticles)
|
||||
article := documents[0]
|
||||
|
||||
if article.IdName != "test_article_1" {
|
||||
log.Fatalf(`Excepted "test_article_1" as IdName, found "%v"`, article.IdName)
|
||||
if article.TitleID != "test_article_1" {
|
||||
log.Fatalf(`Excepted "test_article_1" as IdName, found "%v"`, article.TitleID)
|
||||
} else if article.Date != 1671482492 {
|
||||
log.Fatalf(`Excepted 1671482492 as Date, found "%v"`, article.Date)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user