title: How to fix 'AttributeError: 'dict' object has no attribute ... ' error in python assert
body: <p>I'm setting up a request assertion with request module and python assert keyword but getting </p>
  
  <blockquote>
    <p>AttributeError: 'dict' object has no attribute 'documentation_url'</p>
  </blockquote>
  
  <p>when I try to assert a string in json response. How do I assert something within the json response and when the condition is true, it should print out something?</p>
  
  <pre><code>import requests
  import pprint
  
  URL = 'https://github.com/timeline.json'
  
  def get_github_json(URL):
      response = requests.get(URL).json()
      return response
  
  assert get_github_json(URL).documentation_url == 'https://developer.github.com/v3/activity/events/#list-public-events'
  </code></pre>
  
  <p>The json response looks like this: </p>
  
  <pre><code>{'documentation_url': 'https://developer.github.com/v3/activity/events/#list-public-events',
   'message': 'Hello there, wayfaring stranger. If you’re reading this then you '
              'probably didn’t see our blog post a couple of years back '
              'announcing that this API would go away: http://git.io/17AROg Fear '
              'not, you should be able to get what you need from the shiny new '
              'Events API instead.'
  }
  </code></pre>