本文整理汇总了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()
示例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()
示例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"], {})