Exemple #1
0
def core_factory(create_args,
                 kwargs,
                 session,
                 page,
                 org=None,
                 loc=None,
                 force_context=False):
    """ Performs various factory tasks.

    Updates the ``create_args`` dictionary, calls the ``set_context`` function
    to set ``org`` and ``loc`` context and finally navigates to the entities
    page.

    :param dict create_args: Default entities arguments.
    :param kwargs: Arbitrary keyword arguments to update create_args.
    :param session: The browser session.
    :param page: The entity function for navigation.
    :param str org: The organization context to set.
    :param str loc: The location context to set.
    :param bool force_context: If True set the context again.
    :return: None.

    """
    update_dictionary(create_args, kwargs)
    if org or loc:
        set_context(session, org=org, loc=loc, force_context=force_context)
    page()
Exemple #2
0
def core_factory(create_args, kwargs, session, page, org=None, loc=None, force_context=False):
    """ Performs various factory tasks.

    Updates the ``create_args`` dictionary, calls the ``set_context`` function
    to set ``org`` and ``loc`` context and finally navigates to the entities
    page.

    :param dict create_args: Default entities arguments.
    :param kwargs: Arbitrary keyword arguments to update create_args.
    :param session: The browser session.
    :param page: The entity function for navigation.
    :param str org: The organization context to set.
    :param str loc: The location context to set.
    :param bool force_context: If True set the context again.
    :return: None.

    """
    update_dictionary(create_args, kwargs)
    if org or loc:
        set_context(session, org=org, loc=loc, force_context=force_context)
    page()