Skip to content

Commit

Permalink
[#1471] Fix old test
Browse files Browse the repository at this point in the history
Since organizations were implemented, any unowned dataset can be edited
(and thus deleted) by any user.
We will probably improve this in th future using the creator_user_id
  • Loading branch information
amercader committed Jan 31, 2014
1 parent bb8ae56 commit 7eba75e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ckan/tests/functional/test_package.py
Expand Up @@ -1014,15 +1014,16 @@ def test_delete(self):

offset = url_for(controller='package', action='delete',
id='warandpeace')

self.app.post(offset, extra_environ=self.extra_environ_tester, status=401)
# Since organizations, any owned dataset can be edited/deleted by any
# user
self.app.post(offset, extra_environ=self.extra_environ_tester)

self.app.post(offset, extra_environ=self.extra_environ_admin)

assert model.Package.get('warandpeace').state == u'deleted'

assert plugin.calls['delete'] == 1
assert plugin.calls['after_delete'] == 1
assert plugin.calls['delete'] == 2
assert plugin.calls['after_delete'] == 2
plugins.unload('test_package_controller_plugin')


Expand Down

0 comments on commit 7eba75e

Please sign in to comment.