On Tue, May 12, 2015 at 8:19 PM, Mike Dewhirst <
mi...@dewhirst.com.au> wrote:
> On 13/05/2015 5:07 AM, Larry Martell wrote:
>>
>> I have a situation where I need to run an external python script in a
>> test after the tables are loaded from fixtures. This doesn't work
>> because django runs the tests in a transaction and the external python
>> script is running in its own MySQL connection from the test so it's in
>> its own transaction. When the external python script does something
>> that requires a foreign key look up in a table that was loaded from a
>> fixture it finds that table locked because the transaction in the test
>> has not been committed.
>
>
> Can you convert the script into a class and import it? That should let the
> code run within the transaction.
trying to get it to work. The script in turn forked off another
script, so I also had to instantiate that. And now the test is more
different from the production environment then I'd like. It would have