def test_page_placeholder(self):
        # Attach contents to the parent object.
        page1 = TestPage.objects.create(contents="TEST!")
        placeholder1 = Placeholder.objects.create_for_object(page1, 'slot1')
        item1 = RawHtmlTestItem.objects.create_for_placeholder(placeholder1, html='<b>Item1!</b>', sort_order=1)
        item2 = RawHtmlTestItem.objects.create_for_placeholder(placeholder1, html='<b>Item2!</b>', sort_order=2)

        # Test standard output
        html = self._render("""{% load fluent_contents_tags %}{% page_placeholder page1 "slot1" %}""", {'page1': page1})
        self.assertEqual(html, u'<b>Item1!</b><b>Item2!</b>')

        # Test standard output + template variable
        html = self._render("""{% load fluent_contents_tags %}{% page_placeholder page1 "slot1" template="testapp/placeholder_splitter.html" %}""", {'page1': page1})
        self.assertEqual(html.replace('\n', ''), u'<b>Item1!</b><div class="splitter"></div><b>Item2!</b>')

        # Test if the "page" variable is used as default argument
        html = self._render("""{% load fluent_contents_tags %}{% page_placeholder "slot1" %}""", {'page': page1})
        self.assertEqual(html, u'<b>Item1!</b><b>Item2!</b>')

        # Test of invalid slots fail silently. Give the user the chance to enter the data in the CMS.
        html = self._render("""{% load fluent_contents_tags %}{% page_placeholder page1 "invalid_slot1" %}""", {'page1': page1})
        self.assertEqual(html, u"<!-- placeholder 'invalid_slot1' does not yet exist -->")

        # Test if a missing "page" variable fails.
        self.assertRaises(VariableDoesNotExist, lambda: self._render("""{% load fluent_contents_tags %}{% page_placeholder "slot1" %}""", {}))

        # Test if a missing arguments are reported
        self.assertRaises(TemplateSyntaxError, lambda: Template("""{% load fluent_contents_tags %}{% page_placeholder %}"""))
        self.assertRaises(TemplateSyntaxError, lambda: Template("""{% load fluent_contents_tags %}{% page_placeholder arg1 arg2 arg3 %}"""))
Remove an event.
dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/tests/test_templatetags.py/TemplateTagTests.test_page_placeholder--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/interfaces.py/IReactorWin32Events.removeEvent