Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #3392 from gratipay/disable-route-changes
Browse files Browse the repository at this point in the history
Temporarily disable route changes during migration
  • Loading branch information
chadwhitacre committed May 9, 2015
2 parents 9d76ed9 + bf2d82d commit a2f20a2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/py/test_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from decimal import Decimal as D

from aspen import Response
import pytest

from gratipay.security.user import SESSION
from gratipay.testing import Harness
Expand Down Expand Up @@ -195,6 +196,7 @@ def test_new_participant_can_edit_profile(self):
body = self.client.GET("/alice/", auth_as="alice").body
assert b'Edit' in body

@pytest.mark.xfail
def test_anon_bank_acc_page(self):
body = self.client.GET("/alice/routes/bank-account.html").body
assert "<h1>Bank Account</h1>" in body
7 changes: 7 additions & 0 deletions tests/py/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import balanced
import mock
import pytest

from gratipay.testing.balanced import BalancedHarness
from gratipay.models.exchange_route import ExchangeRoute
Expand Down Expand Up @@ -88,34 +89,40 @@ def test_associate_bitcoin_invalid(self):
self.hit('david', 'associate', 'bitcoin', '12345', expected=400)
assert not ExchangeRoute.from_network(self.david, 'bitcoin')

@pytest.mark.xfail
def test_bank_account(self):
expected = "add or change your bank account"
actual = self.client.GET('/alice/routes/bank-account.html').body
assert expected in actual

@pytest.mark.xfail
def test_bank_account_auth(self):
self.make_participant('alice', claimed_time='now')
expected = '<em id="status">not connected</em>'
actual = self.client.GET('/alice/routes/bank-account.html', auth_as='alice').body
assert expected in actual

@pytest.mark.xfail
def test_credit_card(self):
self.make_participant('alice', claimed_time='now')
expected = "add or change your credit card"
actual = self.client.GET('/alice/routes/credit-card.html').body
assert expected in actual

@pytest.mark.xfail
def test_credit_card_page_shows_card_missing(self):
self.make_participant('alice', claimed_time='now')
expected = 'Your credit card is <em id="status">missing'
actual = self.client.GET('/alice/routes/credit-card.html', auth_as='alice').body.decode('utf8')
assert expected in actual

@pytest.mark.xfail
def test_credit_card_page_loads_when_there_is_a_card(self):
expected = 'Your credit card is <em id="status">working'
actual = self.client.GET('/janet/routes/credit-card.html', auth_as='janet').body.decode('utf8')
assert expected in actual

@pytest.mark.xfail
def test_credit_card_page_shows_card_failing(self):
ExchangeRoute.from_network(self.janet, 'balanced-cc').update_error('Some error')
expected = 'Your credit card is <em id="status">failing'
Expand Down
3 changes: 3 additions & 0 deletions www/%username/routes/bank-account.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ from gratipay.models.exchange_route import ExchangeRoute
from gratipay.utils import get_participant

[-----------------------------------------------------------------------------]

request.redirect('/about/migration')

account = None
bank_account = None
status = ""
Expand Down
2 changes: 2 additions & 0 deletions www/%username/routes/credit-card.html.spt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ from gratipay.utils import get_participant

[-----------------------------------------------------------------------------]

request.redirect('/about/migration')

status = status_msg = ""

if not user.ANON:
Expand Down
17 changes: 17 additions & 0 deletions www/about/migration.spt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[---]
title = _("Temporarily Disabled")
[---] text/html
{% extends "templates/base.html" %}
{% block content %}
<div class="col0">

<p>This functionality is temporarily disabled while we complete <a
href="https://medium.com/gratipay-blog/balancedshutdown-3a9fdb32e9c6">a
difficult migration</a>. Sorry for the inconvenience.</p>

<p>For updates, follow <a href="https://medium.com/gratipay-blog/">our
blog</a>.</p>

</div>
{% endblock %}

0 comments on commit a2f20a2

Please sign in to comment.