Beispiel #1
0
 def test_by_request_group_with_new_member_criteria(self):
     form_data = {'name': 'test group',
                  'accepting_new_members': 'by_request',
                  'new_member_criteria': 'some criteria'}
     form = SuperuserGroupForm(data=form_data)
     ok_(form.is_valid())
     ok_('new_member_criteria' in form.cleaned_data)
Beispiel #2
0
 def test_no_saved_criteria(self):
     form_data = {'name': 'test group',
                  'accepting_new_members': 'no',
                  'new_member_criteria': 'some criteria'}
     form = SuperuserGroupForm(data=form_data)
     ok_(form.is_valid())
     eq_(u'', form.cleaned_data['new_member_criteria'])
Beispiel #3
0
 def test_by_request_group_without_new_member_criteria(self):
     form_data = {'name': 'test group', 'accepting_new_members': 'by_request'}
     form = SuperuserGroupForm(data=form_data)
     eq_(False, form.is_valid())
     ok_('new_member_criteria' in form.errors)