예제 #1
0
    def test__path(self):
        # absoute path from plone site root
        data = Row(index='path', operator='_path', values='/news/')
        parsed = queryparser._absolutePath(MockSite(), data)
        expected = {'path': {'query': ['/%s/news/' % MOCK_SITE_ID]}}
        self.assertEqual(parsed, expected)

        # by uid
        data = Row(index='path', operator='_path', values='00000000000000001')
        parsed = queryparser._absolutePath(MockSite(), data)
        expected = {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}}
        self.assertEqual(parsed, expected)
    def test__path(self):
        # absoute path from plone site root
        data = Row(
            index='path',
            operator='_path',
            values='/news/'
        )
        parsed = queryparser._absolutePath(MockSite(), data)
        expected = {'path': {'query': ['/%s/news/' % MOCK_SITE_ID]}}
        self.assertEqual(parsed, expected)

        # by uid
        data = Row(
            index='path',
            operator='_path',
            values='00000000000000001'
        )
        parsed = queryparser._absolutePath(MockSite(), data)
        expected = {'path': {'query': ['/%s/foo' % MOCK_SITE_ID]}}
        self.assertEqual(parsed, expected)
예제 #3
0
 def test_objStartsWithSiteId(self):
     data = Row(index='path',
                operator='_path',
                values='/{0}-news/'.format(MOCK_SITE_ID))
     parsed = queryparser._absolutePath(MockSite(), data)
     expected = {
         'path': {
             'query': ['/{0}/{1}-news/'.format(MOCK_SITE_ID, MOCK_SITE_ID)]
         }
     }
     self.assertEqual(parsed, expected)