Beispiel #1
0
    def test_group_create(self):
        self.c.login(email='*****@*****.**', password='******')

        response = self._group_create(name='Group', public='true')
        self.assertEqual(response.status_code, 302)
        group_id = self._get_group_id(response)
        self.assertEqual(Group.objects(id=group_id).count(), 1)
Beispiel #2
0
 def clean_name(self):
     name = self.cleaned_data['name']
     params = { 'name__iexact': name }
     if self.group_id:
         params['id__ne'] = self.group_id
     if Group.objects(**params).count() > 0:
         raise forms.ValidationError(_(u"Group with that name already exists"))
     return name
Beispiel #3
0
    def test_group_create(self):
        self.c.login(email='*****@*****.**', password='******')

        response = self._group_create(name='Group',
                                      public='true')
        self.assertEqual(response.status_code, 302)
        group_id = self._get_group_id(response)
        self.assertEqual(Group.objects(id=group_id).count(), 1)
Beispiel #4
0
 def clean_name(self):
     name = self.cleaned_data['name']
     params = {'name__iexact': name}
     if self.group_id:
         params['id__ne'] = self.group_id
     if Group.objects(**params).count() > 0:
         raise forms.ValidationError(
             _(u"Group with that name already exists"))
     return name