          C = 'c', 'C'
  
      def test_charfield_raises_error_on_empty_string(self):
          f = models.CharField()
          with self.assertRaises(ValidationError):
              f.clean('', None)
  
      def test_charfield_cleans_empty_string_when_blank_true(self):
          f = models.CharField(blank=True)
          self.assertEqual('', f.clean('', None))
 
</s> remove         with self.assertRaises(ValidationError):
 </s> add         msg = "Value 'a' is not a valid choice."
        with self.assertRaisesMessage(ValidationError, msg): </s> remove         with self.assertRaises(ValidationError):
 </s> add         msg = 'This field cannot be null.'
        with self.assertRaisesMessage(ValidationError, msg): </s> remove         with self.assertRaises(ValidationError):
 </s> add         msg = "Value 'not a' is not a valid choice."
        with self.assertRaisesMessage(ValidationError, msg):
        msg = 'This field cannot be blank.'
        with self.assertRaisesMessage(ValidationError, msg):
          C = 'c', 'C'
  
      def test_charfield_raises_error_on_empty_string(self):
          f = models.CharField()
        msg = 'This field cannot be blank.'
        with self.assertRaisesMessage(ValidationError, msg):
              f.clean('', None)
  
      def test_charfield_cleans_empty_string_when_blank_true(self):
          f = models.CharField(blank=True)
          self.assertEqual('', f.clean('', None))
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() in CharField tests. 
tests/model_fields/test_charfield.py