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


Python GroupFactory.curator方法代码示例

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


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

示例1: test_group_edit

# 需要导入模块: from mozillians.groups.tests import GroupFactory [as 别名]
# 或者: from mozillians.groups.tests.GroupFactory import curator [as 别名]
 def test_group_edit(self):
     # Curator can edit a group and change (some of) its properties
     data = {
         "name": u"Test Group",
         "accepting_new_members": u"by_request",
         "description": u"lorem ipsum and lah-dee-dah",
         "irc_channel": u"some text, this is not validated",
         "website": u"http://mozillians.org",
         "wiki": u"http://wiki.mozillians.org",
         "members_can_leave": True,
         "visible": True,
         "functional_area": False,
     }
     group = GroupFactory(**data)
     # Must be curator or superuser to edit group. Make user the curator.
     group.curator = self.user.userprofile
     group.save()
     url = reverse("groups:group_edit", prefix="/en-US/", kwargs={"url": group.url})
     # Change some data
     data2 = data.copy()
     data2["description"] = u"A new description"
     data2["wiki"] = u"http://google.com/"
     # make like a form
     del data2["functional_area"]
     with self.login(self.user) as client:
         response = client.post(url, data=data2, follow=False)
     eq_(302, response.status_code)
     group = GroupAlias.objects.get(name=data["name"]).alias
     eq_(data2["description"], group.description)
     ok_(group.visible)
     ok_(group.members_can_leave)
     ok_(not group.functional_area)
开发者ID:venksv,项目名称:mozillians,代码行数:34,代码来源:test_views_misc.py


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