Projet

Général

Profil

0001-python3-define-a-FileType-in-tests-test_commands.py.patch

Paul Marillonnet, 06 mai 2019 16:37

Télécharger (1,07 ko)

Voir les différences:

Subject: [PATCH 1/2] python3: define a FileType in tests/test_commands.py

    as file is not a builtin anymore
 tests/test_commands.py | 7 +++++++
 1 file changed, 7 insertions(+)
tests/test_commands.py
3 3
import json
4 4

  
5 5
from django.core import management
6
from django.utils import six
6 7
from django.utils.timezone import now
7 8
import py
8 9

  
......
10 11
from authentic2_auth_oidc.models import OIDCProvider
11 12
from django_rbac.utils import get_ou_model
12 13

  
14
if six.PY2:
15
    FileType = file
16
else:
17
    from io import TextIOWrapper, BufferedReader, BufferedWriter
18
    FileType = (TextIOWrapper, BufferedReader, BufferedWriter)
19

  
13 20

  
14 21
def test_changepassword(db, simple_user, monkeypatch):
15 22
    import getpass
16
-