@ -1,3 +1,4 @@ | |||||
from django.core import mail | |||||
from django.utils.timezone import now | from django.utils.timezone import now | ||||
from hc.api.models import Check | from hc.api.models import Check | ||||
from hc.test import BaseTestCase | from hc.test import BaseTestCase | ||||
@ -21,6 +22,11 @@ class ProjectTestCase(BaseTestCase): | |||||
self.bobs_membership.refresh_from_db() | self.bobs_membership.refresh_from_db() | ||||
self.assertIsNotNone(self.bobs_membership.transfer_request_date) | self.assertIsNotNone(self.bobs_membership.transfer_request_date) | ||||
# Bob should receive an email notification | |||||
self.assertEqual(len(mail.outbox), 1) | |||||
body = mail.outbox[0].body | |||||
self.assertTrue("/?next=" + self.url in body) | |||||
def test_transfer_project_checks_ownership(self): | def test_transfer_project_checks_ownership(self): | ||||
self.client.login(username="[email protected]", password="password") | self.client.login(username="[email protected]", password="password") | ||||
@ -0,0 +1,19 @@ | |||||
{% extends "emails/base.html" %} | |||||
{% load hc_extras %} | |||||
{% block content %} | |||||
Hello, | |||||
<br /> | |||||
<strong>{{ project.owner.email }}</strong> would like to transfer the ownership of | |||||
their project | |||||
{% if project.name %}<strong>{{ project.name }}</strong>{% endif %} to you. | |||||
<br /><br /> | |||||
To accept or reject this request, please visit the project's Settings | |||||
page: | |||||
{% endblock %} | |||||
{% block content_more %} | |||||
Thanks,<br> | |||||
The {% site_name %} Team | |||||
{% endblock %} |
@ -0,0 +1,14 @@ | |||||
{% load hc_extras %} | |||||
{% block content %}Hello, | |||||
{{ project.owner.email }} would like to transfer the ownership of their | |||||
project {% if project.name %}"{{ project.name }}"{% endif %} to you. | |||||
To accept or reject this request, please visit the project's Settings | |||||
page: | |||||
{{ button_url }} | |||||
Thanks, | |||||
The {% site_name %} Team | |||||
{% endblock %} |
@ -0,0 +1 @@ | |||||
Ownership Transfer Request |