'With the commit_on_success decorator, the transaction is only committed
if the function doesn\'t throw an exception.'

@skipUnlessDBFeature('supports_transactions')
def test_commit_on_success(self):

    committed_on_success = transaction.commit_on_success(self.create_a_reporter_then_fail)
    self.assertRaises(Exception, committed_on_success, 'Dirk', 'Gently')
    self.assertEqual(Reporter.objects.count(), 0)
