diff --git a/django/test/testcases.py b/django/test/testcases.py
index 10bd6c6..ba99bef 100644
|
a
|
b
|
real_commit = transaction.commit
|
| 37 | 37 | real_rollback = transaction.rollback |
| 38 | 38 | real_enter_transaction_management = transaction.enter_transaction_management |
| 39 | 39 | real_leave_transaction_management = transaction.leave_transaction_management |
| 40 | | real_savepoint_commit = transaction.savepoint_commit |
| 41 | | real_savepoint_rollback = transaction.savepoint_rollback |
| 42 | 40 | real_managed = transaction.managed |
| 43 | 41 | |
| 44 | 42 | def nop(*args, **kwargs): |
| … |
… |
def nop(*args, **kwargs):
|
| 47 | 45 | def disable_transaction_methods(): |
| 48 | 46 | transaction.commit = nop |
| 49 | 47 | transaction.rollback = nop |
| 50 | | transaction.savepoint_commit = nop |
| 51 | | transaction.savepoint_rollback = nop |
| 52 | 48 | transaction.enter_transaction_management = nop |
| 53 | 49 | transaction.leave_transaction_management = nop |
| 54 | 50 | transaction.managed = nop |
| … |
… |
def disable_transaction_methods():
|
| 56 | 52 | def restore_transaction_methods(): |
| 57 | 53 | transaction.commit = real_commit |
| 58 | 54 | transaction.rollback = real_rollback |
| 59 | | transaction.savepoint_commit = real_savepoint_commit |
| 60 | | transaction.savepoint_rollback = real_savepoint_rollback |
| 61 | 55 | transaction.enter_transaction_management = real_enter_transaction_management |
| 62 | 56 | transaction.leave_transaction_management = real_leave_transaction_management |
| 63 | 57 | transaction.managed = real_managed |
diff --git a/tests/modeltests/get_or_create/tests.py b/tests/modeltests/get_or_create/tests.py
index 1999b20..3323c88 100644
|
a
|
b
|
|
| 1 | 1 | from datetime import date |
| 2 | 2 | |
| 3 | 3 | from django.db import IntegrityError |
| 4 | | from django.test import TransactionTestCase |
| | 4 | from django.test import TestCase |
| 5 | 5 | |
| 6 | 6 | from models import Person, ManualPrimaryKeyTest |
| 7 | 7 | |
| 8 | 8 | |
| 9 | | class GetOrCreateTests(TransactionTestCase): |
| | 9 | class GetOrCreateTests(TestCase): |
| 10 | 10 | def test_get_or_create(self): |
| 11 | 11 | p = Person.objects.create( |
| 12 | 12 | first_name='John', last_name='Lennon', birthday=date(1940, 10, 9) |