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

All Samples(330)  |  Call(296)  |  Derive(0)  |  Import(34)

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_referenceable.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
 
from Products.Archetypes.config import REFERENCE_CATALOG, UID_CATALOG, UUID_ATTR
    def test_hasUID(self):
        doc = makeContent(self.folder,
                          portal_type='DDocument',
                          title='Foo')
 
        self.assertTrue(hasattr(aq_base(doc), UUID_ATTR))
        self.assertTrue(getattr(aq_base(doc), UUID_ATTR, None))
 
    def test_uuid(self):
        doc = makeContent(self.folder,
        obj_id = 'demodoc'
        new_id = 'new_demodoc'
        doc = makeContent(self.folder,
                          portal_type='DDocument',
                          title='Foo',
    def test_renameKeepsReferences(self):
        container = makeContent(self.folder,
                                portal_type=self.FOLDER_TYPE,
                                title='Spam',
                                id='container')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_referenceable.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
 
from Products.Archetypes.config import REFERENCE_CATALOG, UID_CATALOG, UUID_ATTR
    def test_hasUID(self):
        doc = makeContent(self.folder,
                          portal_type='DDocument',
                          title='Foo')
 
        self.assertTrue(hasattr(aq_base(doc), UUID_ATTR))
        self.assertTrue(getattr(aq_base(doc), UUID_ATTR, None))
 
    def test_uuid(self):
        doc = makeContent(self.folder,
        obj_id = 'demodoc'
        new_id = 'new_demodoc'
        doc = makeContent(self.folder,
                          portal_type='DDocument',
                          title='Foo',
    def test_renameKeepsReferences(self):
        container = makeContent(self.folder,
                                portal_type=self.FOLDER_TYPE,
                                title='Spam',
                                id='container')

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_copying.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.atsitetestcase import portal_owner
from Products.Archetypes.tests.atsitetestcase import portal_name
    def test_copy_and_paste(self):
        ffrom = makeContent(self.folder, portal_type='SimpleFolder', id='cangucu')
        tourist = makeContent(ffrom, portal_type='Fact', id='tourist')
        fto = makeContent(self.folder, portal_type='SimpleFolder', id='london')
        self.assertFalse('tourist' not in ffrom.contentIds())
    def test_cut_and_paste(self):
        ffrom = makeContent(self.folder, portal_type='SimpleFolder', id='cangucu')
        tourist = makeContent(ffrom, portal_type='Fact', id='tourist')
        fto = makeContent(self.folder, portal_type='SimpleFolder', id='london')
        self.assertFalse('tourist' not in ffrom.contentIds())

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_copying.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.atsitetestcase import portal_owner
from Products.Archetypes.tests.atsitetestcase import portal_name
    def test_copy_and_paste(self):
        ffrom = makeContent(self.folder, portal_type='SimpleFolder', id='cangucu')
        tourist = makeContent(ffrom, portal_type='Fact', id='tourist')
        fto = makeContent(self.folder, portal_type='SimpleFolder', id='london')
        self.assertFalse('tourist' not in ffrom.contentIds())
    def test_cut_and_paste(self):
        ffrom = makeContent(self.folder, portal_type='SimpleFolder', id='cangucu')
        tourist = makeContent(ffrom, portal_type='Fact', id='tourist')
        fto = makeContent(self.folder, portal_type='SimpleFolder', id='london')
        self.assertFalse('tourist' not in ffrom.contentIds())

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_marshaller.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.utils import aputrequest
from Products.Archetypes.tests.utils import PACKAGE_HOME
    def XXX_test_textFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
    def test_textFieldObjectRSTreplace(self):
        ## And again with an RST
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        rstFilePath = os.path.join(PACKAGE_HOME, "input", "rest1.rst")
    def test_fileFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='SimpleFile', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_referenceCatalog.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
 
from Products.Archetypes import config
 
        id1 = "firstObject"
        obj = makeContent(self.folder, portal_type='Fact', id=id1)
        self.assertTrue(obj.UID())
 
        brains = uc(UID=obj.UID())
        self.assertTrue(len(brains) == 1)
 
        id2 = "secondObject"
        obj2 = makeContent(self.folder, portal_type='Fact', id=id2)
    def test_holdingref(self):
        rc = getattr(self.portal, config.REFERENCE_CATALOG)
        uc = getattr(self.portal, config.UID_CATALOG)
 
        obj1 = makeContent(self.folder, portal_type='Fact', id='obj1')
        obj2 = makeContent(self.folder, portal_type='Fact', id='obj2')

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_marshaller.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.utils import aputrequest
from Products.Archetypes.tests.utils import PACKAGE_HOME
    def XXX_test_textFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")
    def test_textFieldObjectRSTreplace(self):
        ## And again with an RST
        obj1 = makeContent(self.folder, portal_type='DDocument', id='obj1')
 
        rstFilePath = os.path.join(PACKAGE_HOME, "input", "rest1.rst")
    def test_fileFieldObjectWordReplace(self):
        #test that uploading to an existing object works
        obj1 = makeContent(self.folder, portal_type='SimpleFile', id='obj1')
 
        wordFilePath = os.path.join(PACKAGE_HOME, "input", "word.doc")

src/p/r/Products.Archetypes-HEAD/Products/Archetypes/tests/test_referenceCatalog.py   Products.Archetypes(Download)
 
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import makeContent
 
from Products.Archetypes import config
 
        id1 = "firstObject"
        obj = makeContent(self.folder, portal_type='Fact', id=id1)
        self.assertTrue(obj.UID())
 
        brains = uc(UID=obj.UID())
        self.assertTrue(len(brains) == 1)
 
        id2 = "secondObject"
        obj2 = makeContent(self.folder, portal_type='Fact', id=id2)
    def test_holdingref(self):
        rc = getattr(self.portal, config.REFERENCE_CATALOG)
        uc = getattr(self.portal, config.UID_CATALOG)
 
        obj1 = makeContent(self.folder, portal_type='Fact', id='obj1')
        obj2 = makeContent(self.folder, portal_type='Fact', id='obj2')

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_rename.py   Products.Archetypes(Download)
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
 
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.utils import populateFolder
 
    def test_rename(self):
        obj_id = 'demodoc'
        new_id = 'new_demodoc'
        doc = makeContent(self.folder, portal_type='Fact', id=obj_id)
        content = 'The book is on the table!'

src/p/r/Products.Archetypes-1.10.1/Products/Archetypes/tests/test_widgets.py   Products.Archetypes(Download)
from Products.Archetypes.tests.atsitetestcase import ATSiteTestCase
from Products.Archetypes.tests.utils import PACKAGE_HOME
from Products.Archetypes.tests.utils import makeContent
from Products.Archetypes.tests.test_fields import FakeRequest
from DateTime import DateTime
    def test_subject_keyword_widget(self):
        doc = makeContent(self.folder, portal_type='ComplexType', id='demodoc')
        field = doc.Schema()['subject']
        widget = field.widget
        form = {'subject_keywords': ['bla', 'ble'],
    def test_subject_keyword_widget2(self):
        doc = makeContent(self.folder, portal_type='ComplexType', id='demodoc')
        field = doc.Schema()['selectionlinesfield3']
        widget = field.widget
        form = {'selectionlinesfield3': ['bla', 'ble']}
    def test_subject_keyword_widget_empty(self):
        doc = makeContent(self.folder, portal_type='ComplexType', id='demodoc')
        field = doc.Schema()['subject']
        widget = field.widget
        empty_marker = object()
    def _test_widgets(self):
        doc = makeContent(self.folder, portal_type='ComplexType', id='demodoc')
 
        #Now render this doc in view and edit modes. If this works
        #then we have pretty decent assurance that things are working

  1 | 2 | 3 | 4  Next