fixed failing tests
parent
de6f19c43f
commit
d07a0fec28
|
@ -1,5 +1,4 @@
|
|||
from datetime import date
|
||||
import json
|
||||
|
||||
from behave import then, when
|
||||
from hamcrest import assert_that, equal_to, has_item, none
|
||||
|
@ -9,12 +8,15 @@ from selene.data.account import PRIVACY_POLICY
|
|||
|
||||
@when('a user requests their profile')
|
||||
def call_account_endpoint(context):
|
||||
context.response = context.client.get('/api/account')
|
||||
context.response = context.client.get(
|
||||
'/api/account',
|
||||
content_type='application/json'
|
||||
)
|
||||
|
||||
|
||||
@then('user profile is returned')
|
||||
def validate_response(context):
|
||||
response_data = json.loads(context.response.data)
|
||||
response_data = context.response.json
|
||||
assert_that(
|
||||
response_data['emailAddress'],
|
||||
equal_to(context.account.email_address)
|
||||
|
@ -28,7 +30,7 @@ def validate_response(context):
|
|||
response_data['membership'], has_item('id')
|
||||
)
|
||||
|
||||
assert_that(len(response_data['agreements']), equal_to(1))
|
||||
assert_that(len(response_data['agreements']), equal_to(2))
|
||||
agreement = response_data['agreements'][0]
|
||||
assert_that(agreement['type'], equal_to(PRIVACY_POLICY))
|
||||
assert_that(
|
||||
|
|
Loading…
Reference in New Issue