title: How to correctly use assertRaises in Django
body: <p>I have the following validation function in my model:</p>
  
  <pre><code>@classmethod
  def validate_kind(cls, kind):
      if kind == 'test':
          raise ValidationError("Invalid question kind")
  </code></pre>
  
  <p>which I am trying to test as follows:</p>
  
  <pre><code>w = Model.objects.get(id=1) 
  
  self.assertRaises(ValidationError, w.validate_kind('test'),msg='Invalid question kind')
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>self.assertRaisesRegex(w.validate_kind('test'),'Invalid question kind')
  </code></pre>
  
  <p>Both of these don't work correctly. What am I doing wrong?</p>