From c15d0f62f8b92e9a2c69d9b93ded4cf964ef710c Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 31 May 2010 19:06:42 +0000 Subject: [PATCH] fix and test deletion from admin interface git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@907 e071eeec-0327-468d-9b6a-08194a12b294 --- examples/tests.py | 9 +++++++++ ldapdb/models/base.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/examples/tests.py b/examples/tests.py index 533df5c..465c857 100644 --- a/examples/tests.py +++ b/examples/tests.py @@ -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/') + diff --git a/ldapdb/models/base.py b/ldapdb/models/base.py index 9291c6b..41d00e8 100644 --- a/ldapdb/models/base.py +++ b/ldapdb/models/base.py @@ -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. -- 2.30.2