Ticket #12979: django-test-savepoints.diff

File django-test-savepoints.diff, 2.0 KB (added by Alex Gaynor, 14 years ago)

Includes the removal of a TransactionTestCase.

  • django/test/testcases.py

    diff --git a/django/test/testcases.py b/django/test/testcases.py
    index 10bd6c6..ba99bef 100644
    a b real_commit = transaction.commit  
    3737real_rollback = transaction.rollback
    3838real_enter_transaction_management = transaction.enter_transaction_management
    3939real_leave_transaction_management = transaction.leave_transaction_management
    40 real_savepoint_commit = transaction.savepoint_commit
    41 real_savepoint_rollback = transaction.savepoint_rollback
    4240real_managed = transaction.managed
    4341
    4442def nop(*args, **kwargs):
    def nop(*args, **kwargs):  
    4745def disable_transaction_methods():
    4846    transaction.commit = nop
    4947    transaction.rollback = nop
    50     transaction.savepoint_commit = nop
    51     transaction.savepoint_rollback = nop
    5248    transaction.enter_transaction_management = nop
    5349    transaction.leave_transaction_management = nop
    5450    transaction.managed = nop
    def disable_transaction_methods():  
    5652def restore_transaction_methods():
    5753    transaction.commit = real_commit
    5854    transaction.rollback = real_rollback
    59     transaction.savepoint_commit = real_savepoint_commit
    60     transaction.savepoint_rollback = real_savepoint_rollback
    6155    transaction.enter_transaction_management = real_enter_transaction_management
    6256    transaction.leave_transaction_management = real_leave_transaction_management
    6357    transaction.managed = real_managed
  • tests/modeltests/get_or_create/tests.py

    diff --git a/tests/modeltests/get_or_create/tests.py b/tests/modeltests/get_or_create/tests.py
    index 1999b20..3323c88 100644
    a b  
    11from datetime import date
    22
    33from django.db import IntegrityError
    4 from django.test import TransactionTestCase
     4from django.test import TestCase
    55
    66from models import Person, ManualPrimaryKeyTest
    77
    88
    9 class GetOrCreateTests(TransactionTestCase):
     9class GetOrCreateTests(TestCase):
    1010    def test_get_or_create(self):
    1111        p = Person.objects.create(
    1212            first_name='John', last_name='Lennon', birthday=date(1940, 10, 9)
Back to Top