diff --git a/templates/base.html b/templates/base.html index d266d537cb..46b251f2f5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -66,36 +66,19 @@

{{ banner }}

{% endif %}{% endblock %} - {% if request.path.raw != '/1.0-payout' %} - {% if not user.participant or user.participant.status_of_1_0_payout == 'pending-application' %} -
{{ _( "{nowrap}{a}1.0 payouts{_a} are{_nowrap} {nowrap}available {a2}indefinitely{_a}{_nowrap}." + {{ _( "{nowrap}Our new {a}Terms of Service{_a}{_nowrap} {nowrap}make it {a2}easier to join Gratipay{_a}{_nowrap}." , nowrap=''|safe , _nowrap=''|safe - , a=''|safe - , a2=''|safe + , a=''|safe + , a2=''|safe , _a=''|safe ) }}
- {% elif user.participant and user.participant.status_of_1_0_payout in ('pending-review', 'pending-payout') %} - - - - - - -
{{ _( "{nowrap}Check the status of your{_nowrap} {a}1.0 payout application{_a}." - , nowrap=''|safe - , _nowrap=''|safe - , a=''|safe - , _a=''|safe - ) }}
- {% endif %} - {% endif %}
{% block main %} diff --git a/tests/py/test_notifications.py b/tests/py/test_notifications.py index 9fc0a7981a..549e69bc48 100644 --- a/tests/py/test_notifications.py +++ b/tests/py/test_notifications.py @@ -1,27 +1,30 @@ from gratipay.testing import Harness class TestNotifications(Harness): - def test_add_single_notification(self): - alice = self.make_participant('alice') - alice.add_notification('abcd') - assert alice.notifications == ["abcd"] + def test_add_single_notification(self): + alice = self.make_participant('alice') + alice.add_notification('abcd') + assert alice.notifications == ["abcd"] - def test_add_multiple_notifications(self): - alice = self.make_participant('alice') - alice.add_notification('abcd') - alice.add_notification('1234') - assert alice.notifications == ["abcd", "1234"] + def test_add_multiple_notifications(self): + alice = self.make_participant('alice') + alice.add_notification('abcd') + alice.add_notification('1234') + assert alice.notifications == ["abcd", "1234"] - def test_add_same_notification_twice(self): - alice = self.make_participant('alice') - alice.add_notification('abcd') - alice.add_notification('abcd') - assert alice.notifications == ["abcd"] + def test_add_same_notification_twice(self): + alice = self.make_participant('alice') + alice.add_notification('abcd') + alice.add_notification('abcd') + assert alice.notifications == ["abcd"] - def test_remove_notification(self): - alice = self.make_participant('alice') - alice.add_notification('abcd') - alice.add_notification('1234') - alice.add_notification('bcde') - alice.remove_notification('1234') - assert alice.notifications == ["abcd", "bcde"] + def test_remove_notification(self): + alice = self.make_participant('alice') + alice.add_notification('abcd') + alice.add_notification('1234') + alice.add_notification('bcde') + alice.remove_notification('1234') + assert alice.notifications == ["abcd", "bcde"] + + def test_blog_announcement(self): + assert 'projects-45c46718507b">easier' in self.client.GET('/').body diff --git a/tests/ttw/test_1_0_payout.py b/tests/ttw/test_1_0_payout.py new file mode 100644 index 0000000000..ba22f60591 --- /dev/null +++ b/tests/ttw/test_1_0_payout.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import, division, print_function, unicode_literals + +from gratipay.testing import BrowserHarness + + +class Tests(BrowserHarness): + + def check(self, status, has_request_button, has_check_button): + self.make_participant('alice', claimed_time='now', status_of_1_0_payout=status) + self.sign_in('alice') + self.visit('/~alice/settings/') + + self.css('.account-details a button') + assert self.has_text('Request 1.0 Payout') is has_request_button + + self.css('.account-details a button') + assert self.has_text('Check 1.0 Payout') is has_check_button + + def test_too_little_has_neither(self): + self.check('too-little', False, False) + + def test_pending_application_has_request_button(self): + self.check('pending-application', True, False) + + def test_pending_review_has_check_button(self): + self.check('pending-review', False, True) + + def test_rejected_has_neither(self): + self.check('rejected', False, False) + + def test_pending_payout_has_check_button(self): + self.check('pending-payout', False, True) + + def test_pending_completed_has_neither(self): + self.check('completed', False, False) diff --git a/www/~/%username/settings/index.html.spt b/www/~/%username/settings/index.html.spt index ce0fb6f2d2..e15469ee62 100644 --- a/www/~/%username/settings/index.html.spt +++ b/www/~/%username/settings/index.html.spt @@ -45,6 +45,17 @@ emails = participant.get_emails() {{ format_currency(participant.balance, "USD") }} + {% if user.participant.status_of_1_0_payout.startswith('pending-') %} + + + {% if user.participant.status_of_1_0_payout == 'pending-application' %} + {{ _( "Request 1.0 Payout") }} + {% elif user.participant.status_of_1_0_payout in ('pending-review', 'pending-payout') %} + {{ _( "Check 1.0 Payout") }} + {% endif %} + + + {% endif %}