Did I find the right examples for you? yes no

All Samples(82)  |  Call(82)  |  Derive(0)  |  Import(0)

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testCatalogTool.py   Products.CMFPlone(Download)
    def testIndexObjectUpdatesMetadata(self):
        # Indexing should update metadata
        self.catalog.indexObject(self.folder.doc)
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc)
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.assertEqual(brain.Title, 'Fred')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc, update_metadata=0)
        brain = self.catalog(getId='doc')[0]
        # Metadata did not change
        self.assertEqual(brain.getId, 'doc')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc, idxs=['Title'])
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.assertEqual(brain.Title, 'Fred')
        self.catalog.reindexObject(self.folder.doc, idxs=['Title'],
                                   update_metadata=0)
        brain = self.catalog(getId='doc')[0]
        # Metadata did not change
        self.assertEqual(brain.getId, 'doc')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testCatalogTool.py   Products.CMFPlone(Download)
    def testIndexObjectUpdatesMetadata(self):
        # Indexing should update metadata
        self.catalog.indexObject(self.folder.doc)
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc)
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.assertEqual(brain.Title, 'Fred')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc, update_metadata=0)
        brain = self.catalog(getId='doc')[0]
        # Metadata did not change
        self.assertEqual(brain.getId, 'doc')
        self.folder.doc.setDescription('BamBam')
        self.catalog.reindexObject(self.folder.doc, idxs=['Title'])
        brain = self.catalog(getId='doc')[0]
        self.assertEqual(brain.getId, 'doc')
        self.assertEqual(brain.Title, 'Fred')
        self.catalog.reindexObject(self.folder.doc, idxs=['Title'],
                                   update_metadata=0)
        brain = self.catalog(getId='doc')[0]
        # Metadata did not change
        self.assertEqual(brain.getId, 'doc')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testFolderButtons.py   Products.CMFPlone(Download)
        self.folder.folder_rename(paths=[doc_path], new_ids=['doc1'],
                                  new_titles=[title])
        results = self.catalog(Title='Snooze')
        self.assertTrue(results)
        for result in results:
        self.folder.folder_rename(paths=[doc_path], new_ids=['baz'],
                                  new_titles=[title])
        results = self.catalog(Title='Snooze')
        self.assertTrue(results)
        for result in results:
        self.app.REQUEST.set('paths', [doc_path])
        self.folder.folder_delete()
        results = self.catalog(path=doc_path)
        self.assertFalse(results)
 
        self.setupAuthenticator()
        self.folder.folder_publish(workflow_action='publish', paths=[doc_path])
        results = self.catalog(path=doc_path)
        self.assertEqual(len(results), 1)
        self.assertEqual(results[0].review_state, 'published')

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testFolderButtons.py   Products.CMFPlone(Download)
        self.folder.folder_rename(paths=[doc_path], new_ids=['doc1'],
                                  new_titles=[title])
        results = self.catalog(Title='Snooze')
        self.assertTrue(results)
        for result in results:
        self.folder.folder_rename(paths=[doc_path], new_ids=['baz'],
                                  new_titles=[title])
        results = self.catalog(Title='Snooze')
        self.assertTrue(results)
        for result in results:
        self.app.REQUEST.set('paths', [doc_path])
        self.folder.folder_delete()
        results = self.catalog(path=doc_path)
        self.assertFalse(results)
 
        self.setupAuthenticator()
        self.folder.folder_publish(workflow_action='publish', paths=[doc_path])
        results = self.catalog(path=doc_path)
        self.assertEqual(len(results), 1)
        self.assertEqual(results[0].review_state, 'published')

src/p/r/Products.CMFPlone-5.0a2/Products/CMFPlone/tests/testUnicodeSplitter.py   Products.CMFPlone(Download)
    def testQueryByUmlaut(self):
        self.doc1.SearchableText = '\303\204ffin'
        self.catalog.indexObject(self.doc1)
        brains = self.catalog(SearchableText='\303\204ffin')
        self.assertEqual(len(brains), 1)
 
    def testQueryByUmlautLower(self):
        self.doc1.SearchableText = '\303\204ffin'
        self.catalog.indexObject(self.doc1)
        brains = self.catalog(SearchableText='\303\244ffin')
        self.doc2.SearchableText = '\303\226ffin'
        self.catalog.indexObject(self.doc2)
        brains = self.catalog(SearchableText='\303\226ffin')
        self.assertEqual(len(brains), 1)
 
        self.doc2.SearchableText = '\303\226ffin'
        self.catalog.indexObject(self.doc2)
        brains = self.catalog(SearchableText='\303\266ffin')
        self.assertEqual(len(brains), 1)
 
            self.doc1.SearchableText = '\xc4ffin'
            self.catalog.indexObject(self.doc1)
            brains = self.catalog(SearchableText='\xc4ffin')
            self.assertEqual(len(brains), 1)
        finally:

src/p/r/Products.CMFPlone-HEAD/Products/CMFPlone/tests/testUnicodeSplitter.py   Products.CMFPlone(Download)
    def testQueryByUmlaut(self):
        self.doc1.SearchableText = '\303\204ffin'
        self.catalog.indexObject(self.doc1)
        brains = self.catalog(SearchableText='\303\204ffin')
        self.assertEqual(len(brains), 1)
 
    def testQueryByUmlautLower(self):
        self.doc1.SearchableText = '\303\204ffin'
        self.catalog.indexObject(self.doc1)
        brains = self.catalog(SearchableText='\303\244ffin')
        self.doc2.SearchableText = '\303\226ffin'
        self.catalog.indexObject(self.doc2)
        brains = self.catalog(SearchableText='\303\226ffin')
        self.assertEqual(len(brains), 1)
 
        self.doc2.SearchableText = '\303\226ffin'
        self.catalog.indexObject(self.doc2)
        brains = self.catalog(SearchableText='\303\266ffin')
        self.assertEqual(len(brains), 1)
 
            self.doc1.SearchableText = '\xc4ffin'
            self.catalog.indexObject(self.doc1)
            brains = self.catalog(SearchableText='\xc4ffin')
            self.assertEqual(len(brains), 1)
        finally: