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


Python RegistrationFactory.is_deleted方法代码示例

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


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

示例1: test_check_draft_state_registered_but_deleted

# 需要导入模块: from tests.factories import RegistrationFactory [as 别名]
# 或者: from tests.factories.RegistrationFactory import is_deleted [as 别名]
 def test_check_draft_state_registered_but_deleted(self):
     reg = RegistrationFactory()
     self.draft.registered_node = reg
     reg.is_deleted = True
     self.draft.save()
     try:
         draft_views.check_draft_state(self.draft)
     except Exception:
         self.fail()
开发者ID:AllisonLBowers,项目名称:osf.io,代码行数:11,代码来源:test_views.py

示例2: test_check_draft_state_registered_and_deleted_and_approved

# 需要导入模块: from tests.factories import RegistrationFactory [as 别名]
# 或者: from tests.factories.RegistrationFactory import is_deleted [as 别名]
    def test_check_draft_state_registered_and_deleted_and_approved(self):
        reg = RegistrationFactory()
        self.draft.registered_node = reg
        self.draft.save()
        reg.is_deleted = True
        reg.save()

        with mock.patch('website.project.model.DraftRegistration.is_approved', mock.PropertyMock(return_value=True)):
            try:
                draft_views.check_draft_state(self.draft)
            except HTTPError:
                self.fail()
开发者ID:AllisonLBowers,项目名称:osf.io,代码行数:14,代码来源:test_views.py

示例3: test_draft_with_deleted_registered_node_shows_up_in_draft_list

# 需要导入模块: from tests.factories import RegistrationFactory [as 别名]
# 或者: from tests.factories.RegistrationFactory import is_deleted [as 别名]
 def test_draft_with_deleted_registered_node_shows_up_in_draft_list(self):
     reg = RegistrationFactory(project=self.public_project)
     self.draft_registration.registered_node = reg
     self.draft_registration.save()
     reg.is_deleted = True
     reg.save()
     res = self.app.get(self.url, auth=self.user.auth)
     assert_equal(res.status_code, 200)
     data = res.json["data"]
     assert_equal(len(data), 1)
     assert_equal(data[0]["attributes"]["registration_supplement"], self.schema._id)
     assert_equal(data[0]["id"], self.draft_registration._id)
     assert_equal(data[0]["attributes"]["registration_metadata"], {})
开发者ID:ccfair,项目名称:osf.io,代码行数:15,代码来源:test_node_draft_registration_list.py


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