def test_templatetag_section_is_descendant(self):
        TestSection.load_bulk(BASE_DATA)
        template = Template("""{%load sections%}
        {% section_is_descendant subsection of rootsection as descends %}
        {% if descends%}Passes Test 1{%endif%}
        {% section_is_descendant orphan of rootsection as descends %}
        {% if descends%}{%else%}Passes Test 2{%endif%}
        """)
        context = Context({
            'subsection': TestSection.objects.get(slug='231'),
            'orphan': TestSection.objects.get(slug='1'),
            'rootsection': TestSection.objects.get(slug='2'),
        })

        result = template.render(context)
        self.assertTrue('Passes Test 1' in result)
        self.assertTrue('Passes Test 2' in result)

        # Render with a bad context:
        context = Context({
            'subsection': None,
            'orphan': None,
            'rootsection': None,
        })
        result = template.render(context)
        self.assertTrue('Passes Test 1' not in result)
        self.assertTrue('Passes Test 2' in result)
Adds a temporary authorization code to the database. It takes 3
dataset/ETHPy150Open mazelife/django-scaffold/scaffold/tests.py/SectionTest.test_templatetag_section_is_descendant--crossover with--dataset/ETHPy150Open joaoqalves/web2py-oauth2/modules/oauth/storage/__init__.py/web2pyStorage.add_code