Commit 1c131fc8 authored by Hanno Schlichting's avatar Hanno Schlichting

Avoid having a resource directory and a Python module of the same name

parent 206bd882
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
<five:pagesFromDirectory <five:pagesFromDirectory
for="Products.Five.tests.testing.simplecontent.ISimpleContent" for="Products.Five.tests.testing.simplecontent.ISimpleContent"
module="Products.Five.browser.tests" module="Products.Five.browser.tests"
directory="pages" directory="templates"
permission="zope2.Public" permission="zope2.Public"
/> />
......
...@@ -30,7 +30,7 @@ class ViewPageTemplateFileTests(unittest.TestCase): ...@@ -30,7 +30,7 @@ class ViewPageTemplateFileTests(unittest.TestCase):
self.assertEqual(vptf.id, 'seagull.pt') self.assertEqual(vptf.id, 'seagull.pt')
def test_getId_with_path(self): def test_getId_with_path(self):
vptf = self._makeOne('pages/dirpage1.pt') vptf = self._makeOne('templates/dirpage1.pt')
self.assertEqual(vptf.id, 'dirpage1.pt') self.assertEqual(vptf.id, 'dirpage1.pt')
def test_pt_getEngine(self): def test_pt_getEngine(self):
...@@ -139,7 +139,7 @@ class ViewPageTemplateFileTests(unittest.TestCase): ...@@ -139,7 +139,7 @@ class ViewPageTemplateFileTests(unittest.TestCase):
request = DummyRequest() request = DummyRequest()
response = request.response = DummyResponse() response = request.response = DummyResponse()
view = self._makeView(context, request) view = self._makeView(context, request)
vptf = self._makeOne('pages/dirpage1.pt') vptf = self._makeOne('templates/dirpage1.pt')
body = vptf(view) body = vptf(view)
self.assertEqual(body, DIRPAGE1) self.assertEqual(body, DIRPAGE1)
self.assertEqual(response._headers['Content-Type'], 'text/html') self.assertEqual(response._headers['Content-Type'], 'text/html')
...@@ -150,13 +150,13 @@ class ViewPageTemplateFileTests(unittest.TestCase): ...@@ -150,13 +150,13 @@ class ViewPageTemplateFileTests(unittest.TestCase):
response = request.response = DummyResponse( response = request.response = DummyResponse(
{'Content-Type': 'text/xhtml'}) {'Content-Type': 'text/xhtml'})
view = self._makeView(context, request) view = self._makeView(context, request)
vptf = self._makeOne('pages/dirpage1.pt') vptf = self._makeOne('templates/dirpage1.pt')
body = vptf(view) body = vptf(view)
self.assertEqual(response._headers['Content-Type'], 'text/xhtml') self.assertEqual(response._headers['Content-Type'], 'text/xhtml')
def test___get___(self): def test___get___(self):
from Products.Five.browser.pagetemplatefile import BoundPageTemplate from Products.Five.browser.pagetemplatefile import BoundPageTemplate
template = self._makeOne('pages/dirpage1.pt') template = self._makeOne('templates/dirpage1.pt')
class Foo: class Foo:
def __init__(self, context, request): def __init__(self, context, request):
self.context = context self.context = context
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment