python3: define a FileType in tests/test_commands.py (#32815)

as file is not a builtin anymore
This commit is contained in:
Paul Marillonnet 2019-04-10 19:20:46 +02:00 committed by Benjamin Dauvergne
parent 246e0dcf1f
commit a516e02de0
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import importlib
import json
from django.core import management
from django.utils import six
from django.utils.timezone import now
import py
@ -26,6 +27,12 @@ from authentic2.models import Attribute, DeletedUser
from authentic2_auth_oidc.models import OIDCProvider
from django_rbac.utils import get_ou_model
if six.PY2:
FileType = file
else:
from io import TextIOWrapper, BufferedReader, BufferedWriter
FileType = (TextIOWrapper, BufferedReader, BufferedWriter)
def test_changepassword(db, simple_user, monkeypatch):
import getpass