I am running into a problem parsing out values from a JSON response.
The data coming back in the JSON in the response is:
{"account":{"id":"719fa9e0-a5de-4723-b693-c40cac85c4a4","name":"account_naughton9"}}
What I was trying to use to pull out the values for 'id' and 'name'
data = json.loads(post_create_account_response.text)
account_assert_data = data.get('account_assert_data')
for account_data_parse in account_assert_data:
account_id = account_data_parse['id']
account_name = account_data_parse['name']
print account_id
print account_name
When I run this I get an error back stating:
for account_data_parse in account_assert_data:
TypeError: 'NoneType' object is not iterable
My question is how do I pull out the id and name from this response so I can assert against those values in a unittest?