Skip to content

Commit

Permalink
Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Oct 3, 2017
1 parent 5087e33 commit f9a1696
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_view/test_project_transferownership.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,18 @@ def test_transfer_auth_admin_post(self):

err_msg = "The project owner id should be different"
assert project.owner_id == user.id, err_msg

@with_context
def test_transfer_auth_user_post(self):
"""Test transfer ownership page post is forbidden for not owner."""
admin, owner, user = UserFactory.create_batch(3)
project = ProjectFactory.create(owner=owner)
url = '/project/%s/transferownership?api_key=%s' % (project.short_name,
user.api_key)

assert project.owner_id == owner.id
payload = dict(email_addr=user.email_addr)
res = self.app_post_json(url, data=payload,
follow_redirects=True)
data = json.loads(res.data)
assert data['code'] == 403, data

0 comments on commit f9a1696

Please sign in to comment.