mirror of
https://github.com/getpelican/pelican.git
synced 2026-06-06 15:46:55 +02:00
Merge 15ae7e807b into 3c69dc68d2
This commit is contained in:
commit
f9d9b9514b
2 changed files with 11 additions and 1 deletions
|
|
@ -172,7 +172,7 @@ class Content:
|
|||
def _has_valid_mandatory_properties(self) -> bool:
|
||||
"""Test mandatory properties are set."""
|
||||
for prop in self.mandatory_properties:
|
||||
if not hasattr(self, prop):
|
||||
if not hasattr(self, prop) or getattr(self, prop) in (None, ""):
|
||||
logger.error(
|
||||
"Skipping %s: could not find information about '%s'", self, prop
|
||||
)
|
||||
|
|
|
|||
|
|
@ -734,6 +734,16 @@ class TestArticle(TestBase):
|
|||
custom_article = Article(**article_kwargs)
|
||||
self.assertEqual("custom", custom_article.template)
|
||||
|
||||
def test_empty_title_invalid(self):
|
||||
# articles with empty title should be invalid
|
||||
settings = get_settings()
|
||||
article_kwargs = self._copy_page_kwargs()
|
||||
article_kwargs["metadata"]["title"] = ""
|
||||
article_kwargs["metadata"]["date"] = datetime.datetime.now()
|
||||
article_kwargs["settings"] = settings
|
||||
article = Article(**article_kwargs)
|
||||
self.assertFalse(article.is_valid())
|
||||
|
||||
def test_slugify_category_author(self):
|
||||
settings = get_settings()
|
||||
settings["SLUG_REGEX_SUBSTITUTIONS"] = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue