Exemple #1
0
 def test_access_group_type_closed(self):
     curator = UserFactory.create()
     group = GroupFactory.create(is_access_group=True)
     group.curators.add(curator.userprofile)
     request = RequestFactory().request()
     request.user = curator
     form_data = {'accepting_new_members': Group.CLOSED}
     form = forms.GroupCriteriaForm(data=form_data)
     ok_(form.is_valid())
Exemple #2
0
 def test_access_group_type_open(self):
     curator = UserFactory.create()
     group = GroupFactory.create(is_access_group=True)
     group.curators.add(curator.userprofile)
     request = RequestFactory().request()
     request.user = curator
     form_data = {'accepting_new_members': Group.OPEN}
     form = forms.GroupCriteriaForm(instance=group, data=form_data)
     ok_(not form.is_valid())
     eq_(len(form.errors), 1)