'Test that outer_atomic raises an error if it is nested inside
another atomic.'

def test_outer_atomic_nesting(self):

    if (connection.vendor != 'mysql'):
        raise unittest.SkipTest('Only    works    on    MySQL.')
    outer_atomic()(do_nothing)()
    with atomic():
        atomic()(do_nothing)()
    with outer_atomic():
        atomic()(do_nothing)()
    with self.assertRaisesRegexp(TransactionManagementError, 'Cannot    be    inside    an    atomic    block.'):
        with atomic():
            outer_atomic()(do_nothing)()
    with self.assertRaisesRegexp(TransactionManagementError, 'Cannot    be    inside    an    atomic    block.'):
        with outer_atomic():
            outer_atomic()(do_nothing)()
