Skip to content

Commit

Permalink
Increase coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Oct 3, 2017
1 parent 68eb25c commit 5a069c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_view/test_project_transferownership.py
Expand Up @@ -91,6 +91,23 @@ def test_transfer_auth_owner_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_owner_post_wrong_email(self):
"""Test transfer ownership page post is ok for wrong email."""
admin, owner, user = UserFactory.create_batch(3)
project = ProjectFactory.create(owner=owner)
url = '/project/%s/transferownership?api_key=%s' % (project.short_name,
owner.api_key)

assert project.owner_id == owner.id
payload = dict(email_addr="wrong@email.com")
res = self.app_post_json(url, data=payload,
follow_redirects=True)
data = json.loads(res.data)
assert data['next'] is not None, data
assert "project owner not found" in data['flash'], data
err_msg = "The project owner id should be the same"
assert project.owner_id == owner.id, err_msg

@with_context
def test_transfer_auth_admin_post(self):
Expand Down

0 comments on commit 5a069c7

Please sign in to comment.