Ticket #16490: fix_test_block_mysql_issue.diff

File fix_test_block_mysql_issue.diff, 753 bytes (added by Jim Dalton, 13 years ago)
  • tests/modeltests/select_for_update/tests.py

    diff --git a/tests/modeltests/select_for_update/tests.py b/tests/modeltests/select_for_update/tests.py
    index 24e6d74..c52e41f 100644
    a b class SelectForUpdateTests(TransactionTestCase):  
    205205        # Check the thread has finished. Assuming it has, we should
    206206        # find that it has updated the person's name.
    207207        self.failIf(thread.isAlive())
     208       
     209        # We must commit the transaction to ensure that MySQL gets a fresh read,
     210        # since by default it runs in REPEATABLE READ mode
     211        transaction.commit()
     212       
    208213        p = Person.objects.get(pk=self.person.pk)
    209214        self.assertEqual('Fred', p.name)
    210215
Back to Top