Eliminate all of the exceptions when running the tests.
This commit is contained in:
parent
e1b704bdac
commit
6f39e158d6
10 changed files with 50 additions and 10 deletions
|
@ -113,6 +113,9 @@ class UserCard(ApiResource):
|
|||
def get(self):
|
||||
""" Get the user's credit card. """
|
||||
user = get_authenticated_user()
|
||||
if not user:
|
||||
raise Unauthorized()
|
||||
|
||||
return get_card(user)
|
||||
|
||||
@nickname('setUserCard')
|
||||
|
@ -120,6 +123,9 @@ class UserCard(ApiResource):
|
|||
def post(self):
|
||||
""" Update the user's credit card. """
|
||||
user = get_authenticated_user()
|
||||
if not user:
|
||||
raise Unauthorized()
|
||||
|
||||
token = request.get_json()['token']
|
||||
response = set_card(user, token)
|
||||
log_action('account_change_cc', user.username)
|
||||
|
@ -300,6 +306,9 @@ class UserInvoiceList(ApiResource):
|
|||
def get(self):
|
||||
""" List the invoices for the current user. """
|
||||
user = get_authenticated_user()
|
||||
if not user:
|
||||
raise Unauthorized()
|
||||
|
||||
if not user.stripe_id:
|
||||
raise NotFound()
|
||||
|
||||
|
|
Reference in a new issue