fix and test deletion from admin interface
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 31 May 2010 19:06:42 +0000 (19:06 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 31 May 2010 19:06:42 +0000 (19:06 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@907 e071eeec-0327-468d-9b6a-08194a12b294

examples/tests.py
ldapdb/models/base.py

index 533df5c04dbbda6bdec0b44de51f96085107d230..465c857a50fcb18d9cfdff8e7a28d7f928bb372d 100644 (file)
@@ -243,6 +243,10 @@ class AdminTestCase(BaseTestCase):
         self.assertContains(response, "foogroup")
         self.assertContains(response, "1000")
 
+    def test_group_delete(self):
+        response = self.client.post('/admin/examples/ldapgroup/foogroup/delete/', {'yes': 'post'})
+        self.assertRedirects(response, '/admin/examples/ldapgroup/')
+
     def test_group_search(self):
         response = self.client.get('/admin/examples/ldapgroup/?q=foo')
         self.assertContains(response, "Ldap groups")
@@ -271,3 +275,8 @@ class AdminTestCase(BaseTestCase):
         response = self.client.get('/admin/examples/ldapuser/foouser/')
         self.assertContains(response, "foouser")
         self.assertContains(response, "2000")
+
+    def test_user_delete(self):
+        response = self.client.post('/admin/examples/ldapuser/foouser/delete/', {'yes': 'post'})
+        self.assertRedirects(response, '/admin/examples/ldapuser/')
+
index 9291c6b122656dc4b08e92db20dc30928d22bc28..41d00e8c684b3fa7483973a5478b888808cce290 100644 (file)
@@ -60,6 +60,12 @@ class Model(django.db.models.base.Model):
         super(Model, self).__init__(*args, **kwargs)
         self.saved_pk = self.pk
 
+    def _collect_sub_objects(self, collector):
+        """
+        This private API seems to be called by the admin interface in django 1.2
+        """
+        pass
+
     def build_rdn(self):
         """
         Build the Relative Distinguished Name for this entry.