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): self.fake_context = get_fake_context() self.out = SimpleStringIO() self.textile = TinyTextileParser(self.out, self.fake_context)
def setUp(self): context = get_fake_context() self.URLs = URLs(context)
pre_tag = "<ol>\n" post_tag = "</ol>\n" if currentlen > deep: write(currentlen - deep, pre_tag, spacer(deep)) deep = currentlen elif currentlen < deep: write(deep - currentlen, post_tag, spacer(deep)) deep = currentlen self.out.write( "%s<li>%s</li>\n" % (spacer(deep), item[1]) ) for i in range(deep): self.out.write(post_tag) if __name__ == "__main__": # Quick test from tests.utils.FakeRequest import get_fake_context fake_context = get_fake_context() textile = TinyTextileParser(sys.stdout, fake_context) textile.parse(r""" a windows path: C:\windows\foo\bar a linux path: /usr/bin/python a manuel linebreak\\with two backslashes """)
def setUp(self): self.fake_context = get_fake_context() self.request = self.fake_context["request"] self.request.debug = False self.page_msg = PageMessages(self.fake_context)
else: # Nummerierte Liste pre_tag = "<ol>\n" post_tag = "</ol>\n" if currentlen > deep: write(currentlen - deep, pre_tag, spacer(deep)) deep = currentlen elif currentlen < deep: write(deep - currentlen, post_tag, spacer(deep)) deep = currentlen self.out.write("%s<li>%s</li>\n" % (spacer(deep), item[1])) for i in range(deep): self.out.write(post_tag) if __name__ == "__main__": # Quick test from tests.utils.FakeRequest import get_fake_context fake_context = get_fake_context() textile = TinyTextileParser(sys.stdout, fake_context) textile.parse(r""" a windows path: C:\windows\foo\bar a linux path: /usr/bin/python a manuel linebreak\\with two backslashes """)