Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publisher fix - deleting plugins #569

Merged
9 commits merged into from Dec 13, 2010
Merged

Publisher fix - deleting plugins #569

9 commits merged into from Dec 13, 2010

Conversation

erobit
Copy link
Contributor

@erobit erobit commented Oct 26, 2010

This fix adds a test case for deleting plugins with moderation. In particular the draft plugins were being deleted without moderation / approval and the public plugins were remaining orphaned after the delete.

…oval to deletion of plugin as well as clean up orphaned plugins on the public page after they had been deleted on the draft pages and approved.
@ojii
Copy link
Contributor

ojii commented Oct 26, 2010

I get:

.....................EE.............................................................
======================================================================
ERROR [0.002s]: test_01_revert (cms.tests.reversion_tests.ReversionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jonas/workspace/django-cms/cms/tests/reversion_tests.py", line 53, in setUp
    response = self.client.post(URL_CMS_PAGE_CHANGE % page.pk, p_data)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/test/client.py", line 322, in post
    response = self.request(**r)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/contrib/admin/options.py", line 239, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/views/decorators/cache.py", line 69, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/contrib/admin/sites.py", line 190, in inner
    return view(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/cms/admin/pageadmin.py", line 519, in change_view
    response = super(PageAdmin, self).change_view(request, object_id, extra_context)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/transaction.py", line 299, in _commit_on_success
    res = func(*args, **kw)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 319, in _create_on_success
    self.end()
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 262, in end
    revision_set = self.follow_relationships(self._state.objects)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 246, in follow_relationships
    map(_follow_relationships, object_set)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 230, in _follow_relationships
    related = getattr(obj, relationship, None)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/models/fields/related.py", line 302, in __get__
    rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/models/query.py", line 341, in get
    % self.model._meta.object_name)
DoesNotExist: CMSPlugin matching query does not exist.

======================================================================
ERROR [0.002s]: test_02_recover (cms.tests.reversion_tests.ReversionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jonas/workspace/django-cms/cms/tests/reversion_tests.py", line 53, in setUp
    response = self.client.post(URL_CMS_PAGE_CHANGE % page.pk, p_data)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/test/client.py", line 322, in post
    response = self.request(**r)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/contrib/admin/options.py", line 239, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/utils/decorators.py", line 76, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/views/decorators/cache.py", line 69, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/contrib/admin/sites.py", line 190, in inner
    return view(request, *args, **kwargs)
  File "/home/jonas/workspace/django-cms/cms/admin/pageadmin.py", line 519, in change_view
    response = super(PageAdmin, self).change_view(request, object_id, extra_context)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/transaction.py", line 299, in _commit_on_success
    res = func(*args, **kw)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 319, in _create_on_success
    self.end()
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 262, in end
    revision_set = self.follow_relationships(self._state.objects)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 246, in follow_relationships
    map(_follow_relationships, object_set)
  File "/home/jonas/workspace/_shared_eggs/django_reversion-1.3.2-py2.6.egg/reversion/revisions.py", line 230, in _follow_relationships
    related = getattr(obj, relationship, None)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/models/fields/related.py", line 302, in __get__
    rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
  File "/home/jonas/workspace/django-cms/tests/parts/django/django/db/models/query.py", line 341, in get
    % self.model._meta.object_name)
DoesNotExist: CMSPlugin matching query does not exist.

----------------------------------------------------------------------
Ran 84 tests in 159.694s

FAILED (errors=2)

@ojii
Copy link
Contributor

ojii commented Oct 26, 2010

Oh and I guess I don't have to mention I will not pull changes that cause 'E's

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants