本文整理汇总了Python中mozillians.groups.tests.GroupAliasFactory类的典型用法代码示例。如果您正苦于以下问题:Python GroupAliasFactory类的具体用法?Python GroupAliasFactory怎么用?Python GroupAliasFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GroupAliasFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_set_membership_group_matches_alias
def test_set_membership_group_matches_alias(self):
group_1 = GroupFactory.create(name="foo")
group_2 = GroupFactory.create(name="lo")
GroupAliasFactory.create(alias=group_2, name="bar")
user = UserFactory.create()
user.userprofile.set_membership(Group, ["foo", "bar"])
eq_(set(user.userprofile.groups.all()), set([group_1, group_2]))
开发者ID:J0WI,项目名称:mozillians,代码行数:7,代码来源:test_models.py
示例2: test_search_distict_results
def test_search_distict_results(self):
group_1 = GroupFactory.create(name='automation', visible=True)
GroupAliasFactory.create(alias=group_1, name='automation development')
GroupAliasFactory.create(alias=group_1, name='automation services')
results = Group.search('automation')
eq_(len(results), 1)
eq_(results[0], group_1)
开发者ID:Acidburn0zzz,项目名称:mozillians,代码行数:7,代码来源:test_models.py
示例3: test_name_unique
def test_name_unique(self):
group = GroupFactory.create()
GroupAliasFactory.create(alias=group, name='bar')
form = forms.GroupCreateForm({'name': 'bar', 'accepting_new_members': 'by_request'})
ok_(not form.is_valid())
ok_('name' in form.errors)
msg = u'This name already exists.'
ok_(msg in form.errors['name'])
开发者ID:Acidburn0zzz,项目名称:mozillians,代码行数:8,代码来源:test_forms.py
示例4: test_name_unique
def test_name_unique(self):
group = GroupFactory.create()
GroupAliasFactory.create(alias=group, name='bar')
form = GroupForm({'name': 'bar'})
ok_(not form.is_valid())
ok_('name' in form.errors)
msg = u'This name already exists.'
ok_(msg in form.errors['name'])
开发者ID:royshouvik,项目名称:mozillians,代码行数:8,代码来源:test_forms.py
示例5: test_alias_redirection
def test_alias_redirection(self):
user = UserFactory.create()
group = GroupFactory.create()
group_alias = GroupAliasFactory.create(alias=group)
url = reverse('groups:show_group', kwargs={'url': group_alias.url})
with self.login(user) as client:
response = client.get(url, follow=True)
eq_(response.status_code, 200)
eq_(response.context['group'], group)
开发者ID:Acidburn0zzz,项目名称:mozillians,代码行数:9,代码来源:test_show.py
示例6: test_alias_redirection
def test_alias_redirection(self):
user = UserFactory.create(userprofile={"is_vouched": True})
group = GroupFactory.create()
group_alias = GroupAliasFactory.create(alias=group)
url = reverse("groups:show_group", kwargs={"url": group_alias.url})
with self.login(user) as client:
response = client.get(url, follow=True)
eq_(response.status_code, 200)
eq_(response.context["group"], group)
开发者ID:jakeybrown92,项目名称:mozillians,代码行数:9,代码来源:test_views_show.py
示例7: test_search_matches_alias
def test_search_matches_alias(self):
group_1 = GroupFactory.create(name='lalo', visible=True)
GroupAliasFactory.create(alias=group_1, name='foo')
eq_(set(Group.search('foo')), set([group_1]))
开发者ID:Acidburn0zzz,项目名称:mozillians,代码行数:4,代码来源:test_models.py
示例8: test_unique_name
def test_unique_name(self):
group = GroupFactory.create()
GroupAliasFactory.create(alias=group, name='bar')
group_2 = GroupFactory.build(name='bar')
self.assertRaises(ValidationError, group_2.clean)
开发者ID:Acidburn0zzz,项目名称:mozillians,代码行数:5,代码来源:test_models.py
示例9: test_name_unique
def test_name_unique(self):
group = GroupFactory.create()
GroupAliasFactory.create(alias=group, name="bar")
form = GroupForm({"name": "bar"})
ok_(not form.is_valid())
ok_("name" in form.errors)
开发者ID:J0WI,项目名称:mozillians,代码行数:6,代码来源:test_forms.py
注:本文中的mozillians.groups.tests.GroupAliasFactory类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论