diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-15 00:31:06 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-08-15 00:31:29 +0200 |
| commit | 478a69314e0f1a7fb4e9fd80f2cd3b9f210cc780 (patch) | |
| tree | f8aee7f7c1498f800b21a84367ff06b9419a029b /tests/regressiontests | |
| parent | 450c0df6537e4cb85194754ffa051565f356bbc6 (diff) | |
[py3] Fixed uses of __metaclass__ in tests.
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/introspection/tests.py | 4 | ||||
| -rw-r--r-- | tests/regressiontests/model_forms_regress/tests.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/regressiontests/introspection/tests.py b/tests/regressiontests/introspection/tests.py index 06736a68cb..e7cf7b9e1a 100644 --- a/tests/regressiontests/introspection/tests.py +++ b/tests/regressiontests/introspection/tests.py @@ -4,6 +4,7 @@ from functools import update_wrapper from django.db import connection from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature +from django.utils import six from .models import Reporter, Article @@ -35,8 +36,7 @@ class IgnoreNotimplementedError(type): attrs[k] = ignore_not_implemented(v) return type.__new__(cls, name, bases, attrs) -class IntrospectionTests(TestCase): - __metaclass__ = IgnoreNotimplementedError +class IntrospectionTests(six.with_metaclass(IgnoreNotimplementedError, TestCase)): def test_table_names(self): tl = connection.introspection.table_names() diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py index 3cb129f84e..90c907f2a6 100644 --- a/tests/regressiontests/model_forms_regress/tests.py +++ b/tests/regressiontests/model_forms_regress/tests.py @@ -485,9 +485,8 @@ class CustomMetaclass(ModelFormMetaclass): new.base_fields = {} return new -class CustomMetaclassForm(forms.ModelForm): - __metaclass__ = CustomMetaclass - +class CustomMetaclassForm(six.with_metaclass(CustomMetaclass, forms.ModelForm)): + pass class CustomMetaclassTestCase(TestCase): def test_modelform_factory_metaclass(self): |
