1
0
Fork 0
forked from github/pelican

Remove non-existent tag attribute handling from Content.url_format

This commit is contained in:
Oliver Urs Lenz 2018-11-25 13:27:18 +01:00
commit 6923a7bca0
2 changed files with 1 additions and 15 deletions

View file

@ -213,7 +213,6 @@ class Content(object):
'lang': getattr(self, 'lang', 'en'),
'date': getattr(self, 'date', SafeDatetime.now()),
'author': self.author.slug if hasattr(self, 'author') else '',
'tag': self.tag.slug if hasattr(self, 'tag') else '',
'category': self.category.slug if hasattr(self, 'category') else ''
})
return metadata

View file

@ -11,7 +11,7 @@ from jinja2.utils import generate_lorem_ipsum
import six
from pelican.contents import Article, Author, Category, Page, Static, Tag
from pelican.contents import Article, Author, Category, Page, Static
from pelican.settings import DEFAULT_CONFIG
from pelican.signals import content_object_init
from pelican.tests.support import LoggedTestCase, get_context, get_settings,\
@ -609,19 +609,6 @@ class TestArticle(TestPage):
article = Article(**article_kwargs)
self.assertEqual(article.url, 'fedora.qa/this-week-in-fedora-qa/')
def test_slugify_tags_with_dots(self):
settings = get_settings()
settings['TAG_REGEX_SUBSTITUTIONS'] = [
('Fedora QA', 'fedora.qa'),
]
settings['ARTICLE_URL'] = '{tag}/{slug}/'
article_kwargs = self._copy_page_kwargs()
article_kwargs['metadata']['tag'] = Tag('Fedora QA', settings)
article_kwargs['metadata']['title'] = 'This Week in Fedora QA'
article_kwargs['settings'] = settings
article = Article(**article_kwargs)
self.assertEqual(article.url, 'fedora.qa/this-week-in-fedora-qa/')
def test_valid_save_as_detects_breakout(self):
settings = get_settings()
article_kwargs = self._copy_page_kwargs()