title: Python self.assertRaises
body: <p>I have a small code as below, please help me how to write this in a correct way. I want to check if ID is present in the <code>value</code> and if not then it raises an exception.</p>
  
  <pre><code>value = ({'av' : '123', 'user' : 'abc', 'version' : 'xyz'})
  
  with self.assertRaises(IndexError, value[0]["ID"]):
      print "not an error"
  </code></pre>