  
  
  class TestIsBoundBehavior(SimpleTestCase):
      def test_no_data_raises_validation_error(self):
          with self.assertRaises(ValidationError):
              ArticleFormSet({}).is_valid()
  
      def test_with_management_data_attrs_work_fine(self):
          data = {
              'form-TOTAL_FORMS': '1',
 
</s> remove         with self.assertRaises(DatabaseError):
 </s> add         msg = 'Forced update did not affect any rows.'
        with self.assertRaisesMessage(DatabaseError, msg): </s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = (
            'No authentication backends have been defined. '
            'Does AUTHENTICATION_BACKENDS contain anything?'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = "'apps.apps.NotAConfig' isn't a subclass of AppConfig."
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(TypeError):
 </s> add         with self.assertRaisesMessage(TypeError, msg): </s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = 'Using i18n_patterns in an included URLconf is not allowed.'
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
        msg = 'ManagementForm data is missing or has been tampered with'
        with self.assertRaisesMessage(ValidationError, msg):
  
  
  class TestIsBoundBehavior(SimpleTestCase):
      def test_no_data_raises_validation_error(self):
        msg = 'ManagementForm data is missing or has been tampered with'
        with self.assertRaisesMessage(ValidationError, msg):
              ArticleFormSet({}).is_valid()
  
      def test_with_management_data_attrs_work_fine(self):
          data = {
              'form-TOTAL_FORMS': '1',
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/forms_tests/tests/test_formsets.py