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

All Samples(222)  |  Call(130)  |  Derive(0)  |  Import(92)

src/f/t/ftw.publisher.sender-2.2.0/ftw/publisher/sender/tests/test_example_workflow_constraint_definition.py   ftw.publisher.sender(Download)
from Products.CMFCore.utils import getToolByName
from ftw.builder import Builder
from ftw.builder import create
from ftw.publisher.sender.testing import PUBLISHER_SENDER_FUNCTIONAL_TESTING
from ftw.publisher.sender.tests.pages import Workflow
    def test_warning_on_publish_when_sl_block_has_unpublished_references(self):
        page = create(Builder('content page'))
        other_page = create(Builder('content page').titled('Other Page'))
        other_page_uuid = IUUID(other_page)
        create(Builder('text block')
    def test_warning_on_retract_when_sl_block_has_published_references(self):
        page = create(Builder('content page'))
        other_page = create(Builder('content page')
                            .titled('Other Page')
                            .in_state(EXAMPLE_WF_PUBLISHED))

src/f/t/ftw.publisher.sender-2.2.0/ftw/publisher/sender/tests/test_example_workflow_config.py   ftw.publisher.sender(Download)
from Products.CMFCore.utils import getToolByName
from ftw.builder import Builder
from ftw.builder import create
from ftw.publisher.sender.testing import PUBLISHER_SENDER_INTEGRATION_TESTING
from ftw.publisher.sender.workflows import interfaces
    def test_workflow_has_constraint_definition(self):
        page = create(Builder('page'))
        constraints = getMultiAdapter((page, page.REQUEST),
                                      interfaces.IConstraintDefinition,
                                      name=self.workflow_id)

src/p/l/plonetheme.onegov-1.2.3/plonetheme/onegov/tests/test_navigation_portlet.py   plonetheme.onegov(Download)
from Products.CMFCore.utils import getToolByName
from datetime import datetime
from ftw.builder import Builder
from ftw.builder import create
from ftw.testbrowser import browser
    def test_has_parent_link(self, browser):
        create(Builder('navigation portlet'))
        folder = create(Builder('folder'))
        browser.visit(folder)
        self.assertEquals('Plone site', portlet().css('.parent').first.text)
 
    @browsing
    def test_shows_current_context_title(self, browser):
        create(Builder('navigation portlet'))
    def test_append_view_to_link_if_type_in_property(self, browser):
        create(Builder('navigation portlet'))
        folder = create(Builder('folder').titled('The Folder'))
 
        properties = getToolByName(self.portal, 'portal_properties')

src/f/t/ftw.publisher.sender-2.2.0/ftw/publisher/sender/tests/test_workflow_context_state.py   ftw.publisher.sender(Download)
from Products.CMFCore.utils import getToolByName
from ftw.builder import Builder
from ftw.builder import create
from ftw.publisher.sender.testing import PUBLISHER_SENDER_INTEGRATION_TESTING
from ftw.publisher.sender.workflows.contextstate import PublisherContextState
    def test_component_registered(self):
        page = create(Builder('page'))
        state = queryMultiAdapter((page, self.request),
                                  IPublisherContextState)
        self.assertTrue(state)
    def test_page_has_workflow(self):
        # workflow for type "Document" (alias "page") is installed in "setUp"
        page = create(Builder('page'))
        self.assertTrue(get_state(page).has_workflow())
 
    def test_page_has_publisher_config(self):
        page = create(Builder('page'))
    def test_get_workflow(self):
        page = create(Builder('page'))
        page_workflow = get_state(page).get_workflow()
        self.assertEquals('publisher-example-workflow', page_workflow.id)
 

src/f/t/ftw.contentpage-1.6.5/ftw/contentpage/tests/test_listing_marker.py   ftw.contentpage(Download)
from ftw.builder import Builder
from ftw.builder import create
from ftw.contentpage.interfaces import IAuthority
from ftw.contentpage.testing import FTW_CONTENTPAGE_INTEGRATION_TESTING
from Products.CMFCore.utils import getToolByName
    def test_contentpage_is_extended_with_checkbox(self):
        page = create(Builder('content page'))
 
        fieldname = 'mark_as_authority'
        self.assertIn(fieldname,
                      page.Schema().keys(),
                      '{0} nod found in content page schema'.format(fieldname))
 
    def test_authority_marker_is_set_if_checkbox_is_true(self):
        page = create(Builder('content page'))
    def test_authority_marker_is_not_set_if_checkbox_is_false(self):
        page = create(Builder('content page'))
        page.Schema()['mark_as_authority'].set(page, False)
 
        self.assertFalse(IAuthority.providedBy(page),
                         '{0} is marked for listings'.format(page))
 
    def test_listing_marker_is_not_set_by_default(self):
        page = create(Builder('content page'))

src/f/t/ftw.contentpage-1.6.5/ftw/contentpage/tests/test_authorities_view.py   ftw.contentpage(Download)
from ftw.builder import Builder
from ftw.builder import create
from ftw.contentpage.browser import authorities
from ftw.contentpage.interfaces import IAuthority
from ftw.contentpage.testing import FTW_CONTENTPAGE_FUNCTIONAL_TESTING
    def test_only_first_two_levels_visible(self):
        container = create(Builder('content page'))
 
        first = create(Builder('content page')
                       .titled('First')
    def test_view_has_two_columns(self):
        container = create(Builder('content page'))
 
        create(Builder('content page')
               .titled('One')
    def test_only_pages_with_orgunit_marker_interface_are_displayed(self):
        container = create(Builder('content page'))
 
        create(Builder('content page')
               .titled('With IAuthority')
    def test_pages_are_linked_properly(self):
        container = create(Builder('content page'))
 
        foo = create(Builder('content page')
                     .titled('Foo')

src/f/t/ftw.dashboard.portlets.recentlymodified-1.2.8/ftw/dashboard/portlets/recentlymodified/tests/test_recentlymodified_portlet.py   ftw.dashboard.portlets.recentlymodified(Download)
from ftw.dashboard.portlets.recentlymodified.browser import recentlymodified
from ftw.dashboard.portlets.recentlymodified.testing \
    import FTW_RECENTLYMODIFIED_INTEGRATION_TESTING
from ftw.builder import Builder
from ftw.builder import create
    def test_data(self):
        create(Builder('folder'))
 
        r = self.renderer('/folder')
        self.assertEqual(r._data() > 0, True)
 
    def test_more_link(self):
        create(Builder('folder'))
    def test_add_portlet_with_addview(self):
        create(Builder('folder'))
 
        portal = self.layer['portal']
        portal.folder.restrictedTraverse(
    def test_get_contettype_class_for(self):
        folder = create(Builder('folder'))
        create(Builder('document').within(folder))
 
        portal = self.layer['portal']

src/f/t/ftw.publisher.sender-2.2.0/ftw/publisher/sender/tests/test_publisher_subscribers.py   ftw.publisher.sender(Download)
from Products.CMFCore.utils import getToolByName
from ftw.builder import Builder
from ftw.builder import create
from ftw.publisher.sender.interfaces import IQueue
from ftw.publisher.sender.testing import PUBLISHER_SENDER_FUNCTIONAL_TESTING
    def test_push_job_in_publisher_queue_after_publishing(self):
        page = create(Builder('page'))
        Plone().login().visit(page)
        Workflow().do_transition('publish')
 
    def test_no_job_on_submit(self):
        page = create(Builder('page'))
        Plone().login().visit(page)
        Workflow().do_transition('submit')
 
    def test_no_job_when_object_has_no_publisher_workflow(self):
        queue = IQueue(self.portal)
        page = create(Builder('page'))
        Plone().login().visit(page, 'delete_confirmation')
        self.assertEquals(0, queue.countJobs())
    def test_delete_job_create_when_we_have_a_publisher_workflow(self):
        queue = IQueue(self.portal)
        folder = create(Builder('folder'))
        Plone().login().visit(folder, 'delete_confirmation')
        self.assertEquals(0, queue.countJobs())

src/f/t/ftw.table-1.14.1/ftw/table/tests/test_helper_integration_readable_author.py   ftw.table(Download)
from ftw.builder import Builder
from ftw.builder import create
from ftw.table.helper import readable_author
from ftw.table.testing import FTWTABLE_INTEGRATION_TESTING
from plone.app.testing import TEST_USER_NAME, login, logout
    def test_not_linked_fullname_if_user_exists(self):
        set_allow_anonymous_view_about(self.portal, False)
        create(Builder('user'))
        self.assertEquals('Doe John', readable_author(object, 'john.doe'))
 
    def test_linked_fullname_if_user_exists_and_anonymous_allowed(self):
        set_allow_anonymous_view_about(self.portal, True)
        create(Builder('user'))
 
        self.assertEquals(
    def test_caching(self):
        set_allow_anonymous_view_about(self.portal, False)
        user = create(Builder('user'))
        self.assertEquals('Doe John', readable_author(object, 'john.doe'))
 
    def test_linked_fullname_if_user_exists(self):
        login(self.portal, TEST_USER_NAME)
        create(Builder('user'))
        self.assertEquals(
            '<a href="http://nohost/plone/author/john.doe">Doe John</a>',

src/f/t/ftw.publisher.sender-2.2.0/ftw/publisher/sender/tests/test_workflow_config.py   ftw.publisher.sender(Download)
from Products.CMFCore.utils import getToolByName
from ftw.builder import Builder
from ftw.builder import create
from ftw.publisher.sender.testing import PUBLISHER_SENDER_INTEGRATION_TESTING
from ftw.publisher.sender.workflows import interfaces
    def test_returns_config_for_example_workflow_page(self):
        activate_workflow_for_page(self.portal, 'publisher-example-workflow')
        page = create(Builder('page'))
 
        configs = getUtility(interfaces.IWorkflowConfigs)
    def test_returns_None_if_the_workflow_is_not_a_publisher_workflow(self):
        activate_workflow_for_page(self.portal, 'simple_publication_workflow')
        page = create(Builder('page'))
 
        configs = getUtility(interfaces.IWorkflowConfigs)
    def test_is_published(self):
        page_private = create(Builder('page'))
        page_published = create(Builder('page')
                                .in_state(EXAMPLE_WORKFLOW_PUBLISHED))
        configs = getUtility(interfaces.IWorkflowConfigs)
    def test_is_in_revision(self):
        page_private = create(Builder('page'))
        page_revision = create(Builder('page')
                               .in_state(EXAMPLE_WORKFLOW_REVISION))
        configs = getUtility(interfaces.IWorkflowConfigs)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next