              r2 = Reporter(first_name="Cuthbert", last_name="Calculus", id=r1.id)
              with self.assertRaises(IntegrityError):
                  r2.save(force_insert=True)
              # The transaction is marked as needing rollback.
              with self.assertRaises(transaction.TransactionManagementError):
                  r2.save(force_update=True)
          self.assertEqual(Reporter.objects.get(pk=r1.pk).last_name, "Haddock")
  
      @skipIfDBFeature('atomic_transactions')
      def test_atomic_allows_queries_after_fixing_transaction(self):
 
</s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             msg = 'on_commit() cannot be used in manual transaction management'
            with self.assertRaisesMessage(transaction.TransactionManagementError, msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove         with self.assertRaises(ValueError):
 </s> add         # "name" is treated as an iterable so the output is something like
        # "n, a, m, e" but the order isn't deterministic.
        with self.assertRaisesMessage(ValueError, self.msg % ''):
            msg = (
                "An error occurred in the current transaction. You can't "
                "execute queries until the end of the 'atomic' block."
            )
            with self.assertRaisesMessage(transaction.TransactionManagementError, msg):
              r2 = Reporter(first_name="Cuthbert", last_name="Calculus", id=r1.id)
              with self.assertRaises(IntegrityError):
                  r2.save(force_insert=True)
              # The transaction is marked as needing rollback.
            msg = (
                "An error occurred in the current transaction. You can't "
                "execute queries until the end of the 'atomic' block."
            )
            with self.assertRaisesMessage(transaction.TransactionManagementError, msg):
                  r2.save(force_update=True)
          self.assertEqual(Reporter.objects.get(pk=r1.pk).last_name, "Haddock")
  
      @skipIfDBFeature('atomic_transactions')
      def test_atomic_allows_queries_after_fixing_transaction(self):
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/transactions/tests.py