Skip to content

Commit

Permalink
Standarized and homogenized arguments. Dropped python2-style super
Browse files Browse the repository at this point in the history
  • Loading branch information
andruten committed Feb 14, 2025
1 parent f16e0e0 commit 2262272
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
7 changes: 2 additions & 5 deletions revproxy/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@

import logging

try:
from django.utils.six import string_types
except ImportError:
# Django 3 has no six
string_types = str
from django.template import loader

string_types = str

try:
from diazo.compiler import compile_theme
except ImportError:
Expand Down
8 changes: 1 addition & 7 deletions tests/test_request.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@

import sys

if sys.version_info >= (3, 0, 0):
from urllib.parse import parse_qs
else:
from urlparse import parse_qs
from urllib.parse import parse_qs

from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase, RequestFactory
Expand Down
8 changes: 1 addition & 7 deletions tests/test_transformer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# -*- coding: utf-8 -*-

from sys import version_info

from unittest.mock import patch, MagicMock, PropertyMock

from django.test import RequestFactory, TestCase
Expand All @@ -18,10 +15,7 @@
`¡™£¢∞§¶•ªº–≠œ∑´®†\“‘«åß∂ƒ©˙∆˚¬…æΩ≈ç√∫˜µ≤≥÷
áéíóúÁÉÍÓÚàèìòùÀÈÌÒÙäëïöüÄËÏÖÜãõÃÕçÇ"""

if version_info >= (3, 0, 0):
FILE_CONTENT = bytes(CONTENT, 'utf-8')
else:
FILE_CONTENT = CONTENT
FILE_CONTENT = bytes(CONTENT, 'utf-8')


class CustomProxyView(DiazoProxyView):
Expand Down
6 changes: 1 addition & 5 deletions tests/test_views.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import os
from unittest.mock import patch
from urllib.parse import ParseResult

from django.conf import settings
from django.test import TestCase, RequestFactory, override_settings
try:
from django.utils.six.moves.urllib.parse import ParseResult
except ImportError:
# Django 3 has no six
from urllib.parse import ParseResult

from revproxy.exceptions import InvalidUpstream
from revproxy.views import ProxyView, DiazoProxyView
Expand Down

0 comments on commit 2262272

Please sign in to comment.