当前位置: 首页>>代码示例>>Python>>正文


Python ApplicationFixtureFactory.make_application_form方法代码示例

本文整理汇总了Python中doajtest.fixtures.ApplicationFixtureFactory.make_application_form方法的典型用法代码示例。如果您正苦于以下问题:Python ApplicationFixtureFactory.make_application_form方法的具体用法?Python ApplicationFixtureFactory.make_application_form怎么用?Python ApplicationFixtureFactory.make_application_form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在doajtest.fixtures.ApplicationFixtureFactory的用法示例。


在下文中一共展示了ApplicationFixtureFactory.make_application_form方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestPublisherUpdateRequestFormContext

# 需要导入模块: from doajtest.fixtures import ApplicationFixtureFactory [as 别名]
# 或者: from doajtest.fixtures.ApplicationFixtureFactory import make_application_form [as 别名]
from werkzeug.datastructures import MultiDict

from portality import constants
from doajtest.fixtures import JournalFixtureFactory, ApplicationFixtureFactory
from doajtest.helpers import DoajTestCase
from portality import models
from portality.formcontext import formcontext

#####################################################################
# Source objects to be used for testing
#####################################################################

UPDATE_REQUEST_SOURCE = ApplicationFixtureFactory.make_application_source()
UPDATE_REQUEST_SOURCE["admin"]["application_status"] = constants.APPLICATION_STATUS_UPDATE_REQUEST
UPDATE_REQUEST_FORM = ApplicationFixtureFactory.make_application_form(role="publisher")

######################################################
# Main test class
######################################################

class TestPublisherUpdateRequestFormContext(DoajTestCase):

    def setUp(self):
        super(TestPublisherUpdateRequestFormContext, self).setUp()

    def tearDown(self):
        super(TestPublisherUpdateRequestFormContext, self).tearDown()


    ###########################################################
开发者ID:DOAJ,项目名称:doaj,代码行数:32,代码来源:test_fc_publisher_update_request.py

示例2: mock_lookup_code

# 需要导入模块: from doajtest.fixtures import ApplicationFixtureFactory [as 别名]
# 或者: from doajtest.fixtures.ApplicationFixtureFactory import make_application_form [as 别名]
    return eg

mock_lcc_choices = [
    (u'H', u'Social Sciences'),
    (u'HB1-3840', u'--Economic theory. Demography')
]

def mock_lookup_code(code):
    if code == "H": return "Social Sciences"
    if code == "HB1-3840": return "Economic theory. Demography"
    return None



APPLICATION_SOURCE = ApplicationFixtureFactory.make_application_source()
APPLICATION_FORM = ApplicationFixtureFactory.make_application_form(role="assed")

######################################################
# Main test class
######################################################

class TestAssedAppReview(DoajTestCase):

    def setUp(self):
        super(TestAssedAppReview, self).setUp()

        self.editor_group_pull = models.EditorGroup.pull_by_key
        models.EditorGroup.pull_by_key = editor_group_pull

        self.old_lcc_choices = lcc.lcc_choices
        lcc.lcc_choices = mock_lcc_choices
开发者ID:DOAJ,项目名称:doaj,代码行数:33,代码来源:test_fc_assed_app_review.py

示例3: editor_group_pull_by_key

# 需要导入模块: from doajtest.fixtures import ApplicationFixtureFactory [as 别名]
# 或者: from doajtest.fixtures.ApplicationFixtureFactory import make_application_form [as 别名]
import logging
import re
from StringIO import StringIO
from copy import deepcopy

from portality import constants
from doajtest.fixtures import EditorGroupFixtureFactory, AccountFixtureFactory, ApplicationFixtureFactory, JournalFixtureFactory
from doajtest.helpers import DoajTestCase
from portality import models
from portality.formcontext import formcontext

APPLICATION_SOURCE_TEST_1 = ApplicationFixtureFactory.make_application_source()
APPLICATION_SOURCE_TEST_2 = ApplicationFixtureFactory.make_application_source()
APPLICATION_SOURCE_TEST_3 = ApplicationFixtureFactory.make_application_source()
APPLICATION_FORM = ApplicationFixtureFactory.make_application_form()

JOURNAL_SOURCE_TEST_1 = JournalFixtureFactory.make_journal_source()
JOURNAL_SOURCE_TEST_2 = JournalFixtureFactory.make_journal_source()

EDITOR_GROUP_SOURCE = EditorGroupFixtureFactory.make_editor_group_source()
EDITOR_SOURCE = AccountFixtureFactory.make_editor_source()
ASSED1_SOURCE = AccountFixtureFactory.make_assed1_source()
ASSED2_SOURCE = AccountFixtureFactory.make_assed2_source()
ASSED3_SOURCE = AccountFixtureFactory.make_assed3_source()

#####################################################################
# Mocks required to make some of the lookups work
#####################################################################

@classmethod
def editor_group_pull_by_key(cls, field, value):
开发者ID:DOAJ,项目名称:doaj,代码行数:33,代码来源:test_formcontext_emails.py


注:本文中的doajtest.fixtures.ApplicationFixtureFactory.make_application_form方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。