コード例 #1
0
 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
0
 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
0
ファイル: test_groups_general.py プロジェクト: 0-T-0/copr
 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)
コード例 #4
0
ファイル: test_groups_general.py プロジェクト: 0-T-0/copr
 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)
コード例 #5
0
 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
コード例 #6
0
ファイル: test_groups_general.py プロジェクト: 0-T-0/copr
 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
コード例 #7
0
ファイル: forms.py プロジェクト: tedwardia/copr
 def __call__(self, form, field):
     if UsersLogic.group_alias_exists(field.data):
         raise wtforms.ValidationError(self.message.format(field.data))
コード例 #8
0
ファイル: forms.py プロジェクト: bowlofeggs/copr
 def __call__(self, form, field):
     if UsersLogic.group_alias_exists(field.data):
         raise wtforms.ValidationError(self.message.format(field.data))