mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add test for the new signal
This commit is contained in:
parent
6100773c24
commit
dcb50a20b2
1 changed files with 12 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ from .support import unittest
|
||||||
from pelican.contents import Page, Article
|
from pelican.contents import Page, Article
|
||||||
from pelican.settings import _DEFAULT_CONFIG
|
from pelican.settings import _DEFAULT_CONFIG
|
||||||
from pelican.utils import truncate_html_words
|
from pelican.utils import truncate_html_words
|
||||||
|
from pelican.signals import content_object_init
|
||||||
from jinja2.utils import generate_lorem_ipsum
|
from jinja2.utils import generate_lorem_ipsum
|
||||||
|
|
||||||
# generate one paragraph, enclosed with <p>
|
# generate one paragraph, enclosed with <p>
|
||||||
|
|
@ -158,6 +158,17 @@ class TestPage(unittest.TestCase):
|
||||||
|
|
||||||
return page_kwargs
|
return page_kwargs
|
||||||
|
|
||||||
|
def test_signal(self):
|
||||||
|
"""If a title is given, it should be used to generate the slug."""
|
||||||
|
|
||||||
|
def receiver_test_function(sender,instance):
|
||||||
|
pass
|
||||||
|
|
||||||
|
content_object_init.connect(receiver_test_function ,sender=Page)
|
||||||
|
page = Page(**self.page_kwargs)
|
||||||
|
self.assertTrue(content_object_init.has_receivers_for(Page))
|
||||||
|
|
||||||
|
|
||||||
class TestArticle(TestPage):
|
class TestArticle(TestPage):
|
||||||
def test_template(self):
|
def test_template(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue