This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a notification when identity is viewed
- Loading branch information
1 parent
8335b3b
commit e10b9c4
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ _("Identity Viewed") }} | ||
[---] text/html | ||
{{ _( "This is a transactional email to let you know that {a_viewer}{viewer}{_a} viewed your identity information for {a_country}{country_name}{_a} on Gratipay." | ||
, viewer=viewer | ||
, country_name=country_name | ||
, a_viewer=('<a href="https://gratipay.com/~{}/">'|safe).format(viewer) | ||
, a_country=('<a href="https://gratipay.com/about/me/identities/{}">'|safe).format(country_code) | ||
, _a='</a>'|safe | ||
) }} | ||
[---] text/plain | ||
{{ _( "This is a transactional email to let you know that {viewer} viewed your identity information for {country_name} on Gratipay." | ||
, viewer=viewer | ||
, country_name=country_name | ||
) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
from gratipay.testing import Harness | ||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
from gratipay.models.country import Country | ||
from gratipay.models.participant import Participant | ||
from gratipay.testing.emails import EmailHarness | ||
|
||
|
||
class Tests(Harness): | ||
class Tests(EmailHarness): | ||
|
||
def setUp(self): | ||
super(Tests, self).setUp() | ||
self.make_participant('alice', claimed_time='now', is_admin=True) | ||
self.make_participant('whit537', id=1451, email_address='[email protected]', | ||
claimed_time='now', is_admin=True) | ||
|
@@ -57,9 +60,13 @@ def test_ip_is_200_for_self(self): | |
def test_ip_is_403_for_most_admins(self): | ||
assert self.client.GxT('/~bob/identities/TT', auth_as='alice').code == 403 | ||
|
||
def test_ip_is_200_for_whit537_yikes(self): | ||
def test_ip_is_200_for_whit537_yikes_O_O(self): | ||
assert self.client.GET('/~bob/identities/TT', auth_as='whit537').code == 200 | ||
|
||
def test_ip_notifies_participant_when_whit537_views(self): | ||
self.client.GET('/~bob/identities/TT', auth_as='whit537') | ||
assert 'whit537 viewed your identity' in self.get_last_email()['body_text'] | ||
|
||
def test_ip_is_404_for_unknown_code(self): | ||
assert self.client.GxT('/~bob/identities/XX', auth_as='bob').code == 404 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters