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


Python UsersLogic.group_alias_exists方法代码示例

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


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

示例1: test_group_add_alias_with_space

# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import group_alias_exists [as 别名]
 def test_group_add_alias_with_space(self, f_users, f_fas_groups, f_db):
     fas_name = f_fas_groups[0]
     alias = "alias_1 foo bar"
     assert not UsersLogic.group_alias_exists(alias)
     r = self.test_client.post(
         "/groups/activate/{}".format(fas_name),
         data={"name": alias},
         follow_redirects=True
     )
     assert not UsersLogic.group_alias_exists(alias)
开发者ID:0-T-0,项目名称:copr,代码行数:12,代码来源:test_groups_general.py

示例2: test_group_add_not_in_fas_group

# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import group_alias_exists [as 别名]
 def test_group_add_not_in_fas_group(self, f_users, f_fas_groups, f_db):
     fas_name = f_fas_groups[3]
     alias = "alias_1"
     assert not UsersLogic.group_alias_exists(alias)
     r = self.test_client.post(
         "/groups/activate/{}".format(fas_name),
         data={"name": alias},
         follow_redirects=True
     )
     # assert r.status_code == 403
     assert not UsersLogic.group_alias_exists(alias)
开发者ID:0-T-0,项目名称:copr,代码行数:13,代码来源:test_groups_general.py

示例3: test_group_add_twice

# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import group_alias_exists [as 别名]
 def test_group_add_twice(self, f_users, f_fas_groups, f_db):
     fas_name = f_fas_groups[0]
     alias = "alias_1"
     assert not UsersLogic.group_alias_exists(alias)
     self.test_client.post(
         "/groups/activate/{}".format(fas_name),
         data={"name": alias},
         follow_redirects=True
     )
     assert UsersLogic.group_alias_exists(alias)
     assert len(models.Group.query.all()) == 1
     self.test_client.post(
         "/groups/activate/{}".format(fas_name),
         data={"name": alias},
         follow_redirects=True
     )
     assert len(models.Group.query.all()) == 1
开发者ID:0-T-0,项目名称:copr,代码行数:19,代码来源:test_groups_general.py

示例4: __call__

# 需要导入模块: from coprs.logic.users_logic import UsersLogic [as 别名]
# 或者: from coprs.logic.users_logic.UsersLogic import group_alias_exists [as 别名]
 def __call__(self, form, field):
     if UsersLogic.group_alias_exists(field.data):
         raise wtforms.ValidationError(self.message.format(field.data))
开发者ID:bowlofeggs,项目名称:copr,代码行数:5,代码来源:forms.py


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