Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(11)  |  Derive(0)  |  Import(1)

src/p/r/Products.salesforcepfgadapter-1.9.1/Products/salesforcepfgadapter/tests/testFieldPrepopulation.py   Products.salesforcepfgadapter(Download)
 
from Products.salesforcepfgadapter.tests import base
from Products.salesforcepfgadapter.prepopulator import FieldValueRetriever
from Products.salesforcepfgadapter.config import SESSION_KEY
 
    def testGetRelevantSFAdapter(self):
        retriever = FieldValueRetriever(self.ff1.replyto, self.app.REQUEST)
        sfa = retriever.getRelevantSFAdapter()
        self.failUnless(sfa.aq_base is self.sfa.aq_base)
 
            ))
 
        retriever = FieldValueRetriever(fieldset_field, self.app.REQUEST)
        sfa = retriever.getRelevantSFAdapter()
        self.failUnless(sfa.aq_base is self.sfa.aq_base)
 
    def testRetrieveData(self):
        self._createTestContact()
 
        retriever = FieldValueRetriever(self.ff1.lastname, self.app.REQUEST)
    def testRetrieveDataNothingFound(self):
        self.sfa.setUpdateMatchExpression("string:Email='not-a-real-email'")
        retriever = FieldValueRetriever(self.ff1.lastname, self.app.REQUEST)
        data = retriever.retrieveData()
        self.assertEqual(data, {})