Add test for the new signal

This commit is contained in:
Rachid Belaid 2012-09-02 19:55:31 +01:00
commit dcb50a20b2

View file

@ -5,7 +5,7 @@ from .support import unittest
from pelican.contents import Page, Article
from pelican.settings import _DEFAULT_CONFIG
from pelican.utils import truncate_html_words
from pelican.signals import content_object_init
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
@ -158,6 +158,17 @@ class TestPage(unittest.TestCase):
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):
def test_template(self):
"""