Esempio n. 1
0
 def test_resources(self):
     browserResource('quux', Resource)
     # Only register the checker once, so that multiple test runs pass.
     if Resource not in _checkers:
         defineChecker(Resource, NamesChecker(['__call__']))
     self.addPage('/foo/bar/pt',
                  u'<span tal:replace="context/++resource++quux" />')
     self.verify('/foo/bar/pt', 'http://localhost/@@/quux')
     self.verify('/foo/++vh++https:localhost:443/fake/folders/++/bar/pt',
                 'https://localhost/fake/folders/@@/quux')
Esempio n. 2
0
 def test_resources(self):
     browserResource('quux', Resource)
     # Only register the checker once, so that multiple test runs pass.
     if Resource not in _checkers:
         defineChecker(Resource, NamesChecker(['__call__']))
     self.addPage(u'/foo/bar/pt',
                  u'context/++resource++quux')
     self.verify(u'/foo/bar/pt', u'http://localhost/@@/quux')
     self.verify(u'/foo/++vh++https:localhost:443/fake/folders/++/bar/pt',
                 u'https://localhost/fake/folders/@@/quux')
Esempio n. 3
0
    def testResource(self):
        browserResource("foo", Resource)

        ob = Content()
        r = resource(ob, TestRequest()).traverse("foo", ())
        self.assertEqual(r.__class__, Resource)
Esempio n. 4
0
    def testResource(self):
        browserResource('foo', Resource)

        ob = Content()
        r = resource(ob, TestRequest()).traverse('foo', ())
        self.assertEqual(r.__class__, Resource)