Add some more content language test assertions
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 30 Jul 2019 07:58:58 +0000 (09:58 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 30 Jul 2019 07:58:58 +0000 (09:58 +0200)
See #6136

hugolib/language_content_dir_test.go

index 2fea91fe1ab4b2befcd79bfd790bcef67e00f7af..b0f443fca034645eee5d5cf9c8ec5f4809250695 100644 (file)
@@ -278,6 +278,18 @@ Content.
                }
        }
 
+       for i, p := range nnSite.RegularPages() {
+               msg := fmt.Sprintf("Test %d", i+1)
+               assert.Equal("nn", p.Language().Lang, msg)
+               assert.Contains(p.Title(), "nn", msg)
+       }
+
+       for i, p := range svSite.RegularPages() {
+               msg := fmt.Sprintf("Test %d", i+1)
+               assert.Equal("sv", p.Language().Lang, msg)
+               assert.Contains(p.Title(), "sv", msg)
+       }
+
        // Check bundles
        bundleEn := enSite.RegularPages()[len(enSite.RegularPages())-1]
        bundleNn := nnSite.RegularPages()[len(nnSite.RegularPages())-1]