コード例 #1
0
 def test_group_archived(self, groups):
     form_data = {
         'name': 'Archived Group',
         'description': 'still not very interesting',
         'members': []
     }
     form = ManageRecipientGroupForm(data=form_data)
     form.is_valid()
     assert exists_and_archived(form, RecipientGroup,
                                'group').name == 'Archived Group'
コード例 #2
0
 def test_invalid_form(self, groups):
     form_data = {
         'name': 'Test Group',
         # 'description': 'still not very interesting',
         'members': []
     }
     form = ManageRecipientGroupForm(data=form_data)
     form.is_valid()
     with pytest.raises(ArchivedItemException):
         exists_and_archived(form, RecipientGroup, 'group')
コード例 #3
0
ファイル: test_utils.py プロジェクト: gitter-badger/apostello
 def test_invalid_form(self, groups):
     form_data = {
         'name': 'Test Group',
         # 'description': 'still not very interesting',
         'members': []
     }
     form = ManageRecipientGroupForm(data=form_data)
     form.is_valid()
     with pytest.raises(ArchivedItemException):
         exists_and_archived(form, RecipientGroup, 'group')
コード例 #4
0
ファイル: test_utils.py プロジェクト: gitter-badger/apostello
 def test_group_archived(self, groups):
     form_data = {
         'name': 'Archived Group',
         'description': 'still not very interesting',
         'members': []
     }
     form = ManageRecipientGroupForm(data=form_data)
     form.is_valid()
     assert exists_and_archived(
         form, RecipientGroup, 'group'
     ).name == 'Archived Group'
コード例 #5
0
 def test_duplicate_archived_group(self, recipients, groups):
     form_data = {
         "name": "Archived Group",
         "description": "not very interesting"
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #6
0
 def test_duplicate_archived_group(self, recipients, groups):
     form_data = {
         'name': 'Archived Group',
         'description': 'not very interesting',
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #7
0
 def test_correct_inputs(self, recipients, groups):
     form_data = {
         "name": "test_new_group",
         "description": "not very interesting"
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid()
     form.save()
コード例 #8
0
 def test_duplicate_archived_group(self, recipients, groups):
     form_data = {
         'name': 'Archived Group',
         'description': 'not very interesting',
         'members': ['1']
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #9
0
 def test_duplicate_group(self, recipients, groups):
     form_data = {
         'name': 'Test Group',
         'description': 'not very interesting',
         'members': ['1']
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #10
0
 def test_no_members(self):
     form_data = {
         'name': 'test_new_group',
         'description': 'not very interesting',
         'members': []
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid()
コード例 #11
0
 def test_invalid_members(self, recipients, groups):
     form_data = {
         'name': 'test_new_group',
         'description': 'not very interesting',
         'members': ['57']
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #12
0
 def test_correct_inputs(self, recipients, groups):
     form_data = {
         'name': 'test_new_group',
         'description': 'not very interesting',
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid()
     form.save()
コード例 #13
0
 def test_duplicate_group(self, recipients, groups):
     form_data = {
         'name': 'Test Group',
         'description': 'not very interesting',
         'members': [recipients['calvin'].pk]
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False
コード例 #14
0
 def test_correct_inputs(self, recipients, groups):
     form_data = {
         'name': 'test_new_group',
         'description': 'not very interesting',
         'members': ['1']
     }
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid()
     form.save()
コード例 #15
0
 def test_correct_inputs(self, recipients, groups):
     form_data = {"name": "test_new_group", "description": "not very interesting"}
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid()
     form.save()
コード例 #16
0
 def test_duplicate_archived_group(self, recipients, groups):
     form_data = {"name": "Archived Group", "description": "not very interesting"}
     form = ManageRecipientGroupForm(data=form_data)
     assert form.is_valid() is False