title: How can I unit test django messages?
body: <p>In my django application, I'm trying to write a unit test that performs an action and then checks the messages in the response. </p>
  
  <p>As far as I can tell, there is no nice way of doing this. </p>
  
  <p>I'm using the CookieStorage storage method, and I'd like to do something similar to the following:</p>
  
  <pre><code>    response = self.client.post('/do-something/', follow=True)
      self.assertEquals(response.context['messages'][0], "fail.")
  </code></pre>
  
  <p>The problem is, all I get back is a </p>
  
  <pre><code>print response.context['messages']
  &lt;django.contrib.messages.storage.cookie.CookieStorage object at 0x3c55250&gt;
  </code></pre>
  
  <p>How can I turn this into something useful, or am I doing it all wrong?</p>
  
  <p>Thanks,
  Daniel</p>