test adding a group from admin interface
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Sat, 25 Dec 2010 08:39:43 +0000 (08:39 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Sat, 25 Dec 2010 08:39:43 +0000 (08:39 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@964 e071eeec-0327-468d-9b6a-08194a12b294

examples/tests.py

index 92d9473..0905e12 100644 (file)
@@ -376,9 +376,17 @@ class AdminTestCase(BaseTestCase):
         self.assertContains(response, "foogroup")
         self.assertContains(response, "1000")
 
+    def test_group_add(self):
+        response = self.client.post('/admin/examples/ldapgroup/add/', {'gid': '1002', 'name': 'wizgroup'})
+        self.assertRedirects(response, '/admin/examples/ldapgroup/')
+        qs = LdapGroup.objects.all()
+        self.assertEquals(qs.count(), 3)
+
     def test_group_delete(self):
         response = self.client.post('/admin/examples/ldapgroup/foogroup/delete/', {'yes': 'post'})
         self.assertRedirects(response, '/admin/examples/ldapgroup/')
+        qs = LdapGroup.objects.all()
+        self.assertEquals(qs.count(), 1)
 
     def test_group_search(self):
         response = self.client.get('/admin/examples/ldapgroup/?q=foo')