本文整理汇总了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)
示例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)
示例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
示例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))