Esempio n. 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'
Esempio n. 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')
Esempio n. 3
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')
Esempio n. 4
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'
 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
 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
 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()
 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
 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
 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()
 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
 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()
 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
 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()
 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()
 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