Projet

Général

Profil

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

Paul Marillonnet, 06 mai 2019 16:15

Télécharger (1,38 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
 src/authentic2/compat.py | 1 +
 tests/test_commands.py   | 6 ++++++
 2 files changed, 7 insertions(+)
src/authentic2/compat.py
6 6
from django.db import connection
7 7
from django.db.utils import OperationalError
8 8
from django.core.exceptions import ImproperlyConfigured
9
from django.utils import six
9 10

  
10 11
from django.contrib.auth.tokens import PasswordResetTokenGenerator
11 12

  
tests/test_commands.py
10 10
from authentic2_auth_oidc.models import OIDCProvider
11 11
from django_rbac.utils import get_ou_model
12 12

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

  
13 19

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