From: jlaine Date: Mon, 31 May 2010 19:06:42 +0000 (+0000) Subject: fix and test deletion from admin interface X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c15d0f62f8b92e9a2c69d9b93ded4cf964ef710c;p=matthijs%2Fupstream%2Fdjango-ldapdb.git fix and test deletion from admin interface git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@907 e071eeec-0327-468d-9b6a-08194a12b294 --- 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.