diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-18 16:40:03 +0200 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-05-18 16:49:15 +0200 |
commit | 3634948c883c89a9dbf303b9687331a2a5db43ce (patch) | |
tree | 7ca7c36b50b8d66d9effbee5e801312d8c7c2613 /tests/transactions/tests.py | |
parent | 63a9555d57069cee32de388821dbe580da1f97c0 (diff) | |
download | django-3634948c883c89a9dbf303b9687331a2a5db43ce.tar.gz |
Moved IgnorePendingDeprecationWarningsMixin in django.test.utils.
This mixin is useful whenever deprecating a large part of Django.
Diffstat (limited to 'tests/transactions/tests.py')
-rw-r--r-- | tests/transactions/tests.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py index aeb9bc3d2c..0f16a9c805 100644 --- a/tests/transactions/tests.py +++ b/tests/transactions/tests.py @@ -5,6 +5,7 @@ import warnings from django.db import connection, transaction, IntegrityError from django.test import TransactionTestCase, skipUnlessDBFeature +from django.test.utils import IgnorePendingDeprecationWarningsMixin from django.utils import six from django.utils.unittest import skipIf, skipUnless @@ -319,19 +320,6 @@ class AtomicMiscTests(TransactionTestCase): transaction.atomic(Callable()) -class IgnorePendingDeprecationWarningsMixin(object): - - def setUp(self): - super(IgnorePendingDeprecationWarningsMixin, self).setUp() - self.catch_warnings = warnings.catch_warnings() - self.catch_warnings.__enter__() - warnings.filterwarnings("ignore", category=PendingDeprecationWarning) - - def tearDown(self): - self.catch_warnings.__exit__(*sys.exc_info()) - super(IgnorePendingDeprecationWarningsMixin, self).tearDown() - - class TransactionTests(IgnorePendingDeprecationWarningsMixin, TransactionTestCase): def create_a_reporter_then_fail(self, first, last): |