'Test that no TransactionManagementError is raised
when select_for_update is invoked outside of a transaction -
only when the query is executed.'

@skipUnlessDBFeature('has_select_for_update')
def test_for_update_requires_transaction_only_in_execution(self):

    transaction.set_autocommit(True)
    try:
        people = Person.objects.all().select_for_update()
        with self.assertRaises(transaction.TransactionManagementError):
            list(people)
    finally:
        transaction.set_autocommit(True)
