def setUp(self):
     test_template = tests.create_template(
         content = "{% lucidTag page_counter %}"
     )
     # Create the test pages defined in content_test_utils.py
     # assign the test template to all pages
     tests.create_pages(tests.TEST_PAGES, template=test_template)
    def setUp(self):
        """
        Create a clean page table.
        """
        Page.objects.all().delete() # Delete all existins pages

        self.template = tests.create_template(
            content = "{% lucidTag main_menu %}"
        )

        tests.create_pages(tests.TEST_PAGES, template=self.template)
    def setUp(self):
        self.fake_context = get_fake_context()
        Page.objects.all().delete() # Delete all existins pages

        self.template = tests.create_template(content = TEST_TEMPLATE)

        # Create the test pages defined in content_test_utils.py
        # assign the test template to all pages
        tests.create_pages(
            tests.TEST_PAGES,
            template=self.template,
        )
    def setUp(self):
        """
        Create a clean page table.
        """
        Page.objects.all().delete() # Delete all existins pages

        self.template = tests.create_template(
            content = "{% lucidTag back_links %}"
        )

        # Create the test pages defined in content_test_utils.py
        # assign the test template to all pages
        tests.create_pages(tests.TEST_PAGES, template=self.template)
    def test_base(self):
        test_pages = [{
            'name': '1_AAA',
            'subitems': [
                {'name': '1_2_BBB'}
            ]
        }]
        tests.create_pages(test_pages, template=self.template)
#        self.create_link_snapshot()
        snapshot = {
            u'/1_AAA/': [
                ('/1_AAA/', '1_AAA'), ('/1_AAA/1_2_BBB/', '1_2_BBB')
            ],
            u'/1_AAA/1_2_BBB/': [
                ('/1_AAA/', '1_AAA'), ('/1_AAA/1_2_BBB/', '1_2_BBB')
            ]
        }
        self.link_snapshot_test(snapshot)
    def setUp(self):
        """
        Create a clean page table.
        Create the test pages with a test template and stylesheet.
        """
        Page.objects.all().delete() # Delete all existins pages

        self.template = tests.create_template(
            content = "{% lucidTag page_style %}"
        )
        self.style = tests.create_stylesheet(
            name = "TestStyle", content = TEST_STYLE_CONTENT,
        )

        # Create the test pages defined in content_test_utils.py
        # assign the test template and stylesheet to all pages
        tests.create_pages(
            tests.TEST_PAGES,
            template=self.template,
            style = self.style,
        )
    def test_escape_names(self):
        """
        Test with some spezial characters in page names
        """
        test_pages = [{
            'name': '{{ A }} {% B %} <C>',
            'title': '{{ a }} {% b %} <c>',
            'subitems': [
                {'name': '{{ 1 }} {% 2 % } <3>'}
            ]
        }]
        tests.create_pages(test_pages, template=self.template)
#        self.create_link_snapshot()
        snapshot = {
            u'/A-B-C/': [
                ('/A-B-C/', '{{ A }} {% B %} &lt;C&gt;'),
                ('/A-B-C/1-2-3/', '{{ 1 }} {% 2 % } &lt;3&gt;')
            ],
            u'/A-B-C/1-2-3/': [
                ('/A-B-C/', '{{ A }} {% B %} &lt;C&gt;'),
                ('/A-B-C/1-2-3/', '{{ 1 }} {% 2 % } &lt;3&gt;')
            ]
        }
        self.link_snapshot_test(snapshot)