def testTTGetPosition(self):
        # Simple tests
        t = "{% load position_tags %}{% get_position sample_position as p %}{{ p.name }}"
        self.assertEqual(render(t), "sample_position")
        
        # If the case of a missing position, the template tag doesnt return anything
        t = "{% load position_tags %}{% get_position missing_position as p %}{{ p.name }}"
        self.assertEqual(render(t), "")
        
        # Prefix test
        pos = Position.objects.create(name="myprefix__myposition")
        t = "{% load position_tags %}{% get_position myprefix myposition as p %}{{ p.name }}"
        self.assertEqual(render(t), "myprefix__myposition")
        
        # Variable tests
        c = SimpleCategory.objects.create(name="mycategory")
        p = Position.objects.create(name="mycategory")
        
        t = "{% load position_tags %}{% get_position category.name as mycatposition %}{{ mycatposition.name }}"
        self.assertEqual(render(t, {'category': c}), "mycategory")
        
        # Variable name with variable prefix
        p = Position.objects.create(name="section__mycategory")
        t = "{% load position_tags %}{% get_position sec category.name as mycatposition %}{{ mycatposition.name }}"
        self.assertEqual(render(t, {'sec': 'section', 'category': c}), "section__mycategory")
        
        # Slugify test
        c = SimpleCategory.objects.create(name="Awesome Category")
        p = Position.objects.create(name="awesome-category")
        t = "{% load position_tags %}{% get_position category.name as mycatposition slugify=True %}{{ mycatposition.name }}"
        render(t, {'category': c})
        self.assertEqual(render(t, {'category': c}), "awesome-category")
{% get_position [name] as [varname] %}
dataset/ETHPy150Open callowayproject/django-kamasutra/positions/tests.py/PositionsTestCase.testTTGetPosition