def test_render_placeholder(self):
        # Attach contents to the parent object.
        page2 = PlaceholderFieldTestPage.objects.create()
        placeholder1 = Placeholder.objects.create_for_object(page2, 'field_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)

        # Make sure the unittests won't succeed because of cached output.
        appsettings.FLUENT_CONTENTS_CACHE_OUTPUT = False
        cache.clear()

        # Test standard behavior, with an object reference
        # - fetch ContentItem
        # - fetch RawHtmlTestItem
        with self.assertNumQueries(2) as ctx:
            html = self._render("""{% load fluent_contents_tags %}{% render_placeholder placeholder1 %}""", {'placeholder1': placeholder1})
            self.assertEqual(html, u'<b>Item1!</b><b>Item2!</b>')

        # Test passing Placeholder via PlaceholderField (actually tests the PlaceholderFieldDescriptor)
        # - fetch Placeholder
        # - fetch ContentItem
        # - fetch RawHtmlTestItem
        with self.assertNumQueries(3) as ctx:
            html = self._render("""{% load fluent_contents_tags %}{% render_placeholder page2.contents %}""", {'page2': page2})
            self.assertEqual(html, u'<b>Item1!</b><b>Item2!</b>')

        # Test passing a related object manager.
        # - fetch Placeholder
        # - parent is taken from RelatedManager
        # - fetch ContentItem
        # - fetch RawHtmlTestItem
        with self.assertNumQueries(3) as ctx:
            html = self._render("""{% load fluent_contents_tags %}{% render_placeholder page2.placeholder_set %}""", {'page2': page2})
            self.assertEqual(html, u'<b>Item1!</b><b>Item2!</b>')

        # Test if None values fail silently
        with self.assertNumQueries(0) as ctx:
            html = self._render("""{% load fluent_contents_tags %}{% render_placeholder none_object %}""", {'none_object': None})
            self.assertEqual(html, u'<!-- placeholder object is None -->')

        # Test if invalid objects are reported.
        # This requires `TEMPLATE_DEBUG = False` in Django 1.3
        self.assertRaises(ValueError, lambda: self._render("""{% load fluent_contents_tags %}{% render_placeholder 123 %}""", {}))
        self.assertRaises(ValueError, lambda: self._render("""{% load fluent_contents_tags %}{% render_placeholder int_object %}""", {'int_object': 456}))

        # Test if a missing arguments are reported
        self.assertRaises(TemplateSyntaxError, lambda: Template("""{% load fluent_contents_tags %}{% render_placeholder %}"""))
        self.assertRaises(TemplateSyntaxError, lambda: Template("""{% load fluent_contents_tags %}{% render_placeholder arg1 arg2 %}"""))
sets the a time of a file to the current time
dataset/ETHPy150Open edoburu/django-fluent-contents/fluent_contents/tests/test_templatetags.py/TemplateTagTests.test_render_placeholder--crossover with--dataset/ETHPy150Open FredHutch/swift-commander/swift_commander/swsymlinks.py/setfiletime