本文整理汇总了Python中tests.factories.ProjectFactory.is_registration方法的典型用法代码示例。如果您正苦于以下问题:Python ProjectFactory.is_registration方法的具体用法?Python ProjectFactory.is_registration怎么用?Python ProjectFactory.is_registration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tests.factories.ProjectFactory
的用法示例。
在下文中一共展示了ProjectFactory.is_registration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_has_permission_on_parent_node_copyto_pass_if_registration
# 需要导入模块: from tests.factories import ProjectFactory [as 别名]
# 或者: from tests.factories.ProjectFactory import is_registration [as 别名]
def test_has_permission_on_parent_node_copyto_pass_if_registration(self):
component_admin = AuthUserFactory()
component = ProjectFactory(creator=component_admin, parent=self.node)
component.is_registration = True
assert_false(component.has_permission(self.user, 'write'))
res = views.check_access(component, Auth(user=self.user), 'copyto', None)
assert_true(res)
示例2: test_turning_private_registrations_public
# 需要导入模块: from tests.factories import ProjectFactory [as 别名]
# 或者: from tests.factories.ProjectFactory import is_registration [as 别名]
def test_turning_private_registrations_public(self):
node1 = ProjectFactory(creator=self.user, is_public=False)
node2 = ProjectFactory(creator=self.user, is_public=False)
node1.is_registration = True
node1.registered_from = node2
node1.registered_date = node1.date_modified
node1.save()
payload = {
"data": {
"id": node1._id,
"type": "registrations",
"attributes": {
"public": True,
}
}
}
url = '/{}registrations/{}/'.format(API_BASE, node1._id)
res = self.app.put_json_api(url, payload, auth=self.user.auth)
assert_equal(res.json['data']['attributes']['public'], True)