From d9eeeeea61234b6c4d16cf4299146b024fca073c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= <fpeters@entrouvert.com>
Date: Fri, 15 Apr 2022 16:42:01 +0200
Subject: [PATCH] misc: remove usage of django.utils.six (#63683)

---
 combo/apps/assets/api_views.py    | 2 +-
 combo/apps/assets/utils.py        | 2 +-
 combo/apps/assets/views.py        | 2 +-
 combo/manager/views.py            | 2 +-
 combo/utils/requests_wrapper.py   | 2 +-
 tests/test_assets.py              | 2 +-
 tests/test_cron.py                | 2 +-
 tests/test_import_export.py       | 2 +-
 tests/test_manager.py             | 2 +-
 tests/test_pages.py               | 2 +-
 tests/test_public.py              | 2 +-
 tests/test_public_templatetags.py | 2 +-
 tests/test_pwa.py                 | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/combo/apps/assets/api_views.py b/combo/apps/assets/api_views.py
index f9aa3a71..caa91690 100644
--- a/combo/apps/assets/api_views.py
+++ b/combo/apps/assets/api_views.py
@@ -15,9 +15,9 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import base64
+from io import BytesIO
 
 from django.core.files import File
-from django.utils.six import BytesIO
 from rest_framework import permissions, serializers, status
 from rest_framework.generics import GenericAPIView
 from rest_framework.response import Response
diff --git a/combo/apps/assets/utils.py b/combo/apps/assets/utils.py
index b2388721..9b2fb182 100644
--- a/combo/apps/assets/utils.py
+++ b/combo/apps/assets/utils.py
@@ -17,9 +17,9 @@
 import json
 import os
 import tarfile
+from io import BytesIO
 
 from django.core.files.storage import default_storage
-from django.utils.six import BytesIO
 
 from .models import Asset
 
diff --git a/combo/apps/assets/views.py b/combo/apps/assets/views.py
index e326ea0f..e8f78f3f 100644
--- a/combo/apps/assets/views.py
+++ b/combo/apps/assets/views.py
@@ -16,6 +16,7 @@
 
 import os
 import tarfile
+from io import BytesIO
 
 import ckeditor
 from django.conf import settings
@@ -25,7 +26,6 @@ from django.core.files.storage import default_storage
 from django.http import Http404, HttpResponse
 from django.shortcuts import get_object_or_404, redirect
 from django.urls import reverse, reverse_lazy
-from django.utils.six import BytesIO
 from django.utils.translation import ugettext_lazy as _
 from django.views.generic import FormView, ListView, TemplateView
 from sorl.thumbnail.shortcuts import get_thumbnail
diff --git a/combo/manager/views.py b/combo/manager/views.py
index 37319fa5..2526bb9c 100644
--- a/combo/manager/views.py
+++ b/combo/manager/views.py
@@ -18,6 +18,7 @@ import datetime
 import hashlib
 import json
 import tarfile
+from io import BytesIO
 from operator import attrgetter, itemgetter
 
 from django import forms, template
@@ -31,7 +32,6 @@ from django.template import engines
 from django.urls import reverse, reverse_lazy
 from django.utils.encoding import force_bytes, force_text
 from django.utils.formats import date_format
-from django.utils.six import BytesIO
 from django.utils.timezone import localtime
 from django.utils.translation import ugettext_lazy as _
 from django.views.decorators.csrf import requires_csrf_token
diff --git a/combo/utils/requests_wrapper.py b/combo/utils/requests_wrapper.py
index 5a71d93a..0ce13c44 100644
--- a/combo/utils/requests_wrapper.py
+++ b/combo/utils/requests_wrapper.py
@@ -17,12 +17,12 @@
 import hashlib
 import logging
 import urllib.parse
+from io import BytesIO
 
 from django.conf import settings
 from django.core.cache import cache
 from django.utils.encoding import smart_bytes
 from django.utils.http import urlencode
-from django.utils.six import BytesIO
 from requests import Response
 from requests import Session as RequestsSession
 from requests.auth import AuthBase
diff --git a/tests/test_assets.py b/tests/test_assets.py
index e5560c99..d615d26d 100644
--- a/tests/test_assets.py
+++ b/tests/test_assets.py
@@ -1,12 +1,12 @@
 import base64
 import os
 import tarfile
+from io import BytesIO
 
 import pytest
 from django.core.files import File
 from django.core.files.storage import default_storage
 from django.urls import reverse
-from django.utils.six import BytesIO
 
 from combo.apps.assets.models import Asset
 from combo.apps.assets.utils import (
diff --git a/tests/test_cron.py b/tests/test_cron.py
index dbcd35b9..ca944389 100644
--- a/tests/test_cron.py
+++ b/tests/test_cron.py
@@ -1,10 +1,10 @@
+from io import StringIO
 from unittest import mock
 
 import pytest
 from django.core.management import call_command
 from django.core.management.base import CommandError
 from django.test import override_settings
-from django.utils.six import StringIO
 
 pytestmark = pytest.mark.django_db
 
diff --git a/tests/test_import_export.py b/tests/test_import_export.py
index c3d9ef00..e554142e 100644
--- a/tests/test_import_export.py
+++ b/tests/test_import_export.py
@@ -5,6 +5,7 @@ import shutil
 import sys
 import tarfile
 import tempfile
+from io import BytesIO, StringIO
 
 import pytest
 from django.contrib.auth.models import Group
@@ -13,7 +14,6 @@ from django.core.files.storage import default_storage
 from django.core.management import call_command
 from django.core.management.base import CommandError
 from django.utils.encoding import force_bytes, force_text
-from django.utils.six import BytesIO, StringIO
 
 from combo.apps.assets.models import Asset
 from combo.apps.assets.utils import clean_assets_files
diff --git a/tests/test_manager.py b/tests/test_manager.py
index 2ed3e641..938d4817 100644
--- a/tests/test_manager.py
+++ b/tests/test_manager.py
@@ -5,6 +5,7 @@ import os
 import re
 import shutil
 import urllib.parse
+from io import BytesIO
 from unittest import mock
 
 import pytest
@@ -21,7 +22,6 @@ from django.test.utils import CaptureQueriesContext
 from django.urls import reverse
 from django.utils.encoding import force_bytes, force_str
 from django.utils.http import urlencode
-from django.utils.six import BytesIO
 from django.utils.timezone import now
 from pyquery import PyQuery
 from webtest import Upload
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 8bf04deb..50989975 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -1,12 +1,12 @@
 import os
 import sys
+from io import StringIO
 
 import pytest
 from django.conf import settings
 from django.contrib.auth.models import Group, User
 from django.test import override_settings
 from django.test.client import RequestFactory
-from django.utils.six import StringIO
 
 from combo.data.management.commands.export_site import Command as ExportSiteCommand
 from combo.data.management.commands.import_site import Command as ImportSiteCommand
diff --git a/tests/test_public.py b/tests/test_public.py
index 1b9f272c..fa32f4b9 100644
--- a/tests/test_public.py
+++ b/tests/test_public.py
@@ -3,6 +3,7 @@ import json
 import os
 import re
 import urllib.parse
+from io import StringIO
 from unittest import mock
 
 import pytest
@@ -14,7 +15,6 @@ from django.test import override_settings
 from django.test.utils import CaptureQueriesContext
 from django.urls import reverse
 from django.utils.http import quote
-from django.utils.six import StringIO
 
 try:
     import mellon  # pylint: disable=unused-import
diff --git a/tests/test_public_templatetags.py b/tests/test_public_templatetags.py
index b24fd2b4..2d2515c8 100644
--- a/tests/test_public_templatetags.py
+++ b/tests/test_public_templatetags.py
@@ -2,6 +2,7 @@ import datetime
 import os
 import shutil
 import time
+from io import StringIO
 
 import pytest
 from django.contrib.auth.models import AnonymousUser, Group, User
@@ -11,7 +12,6 @@ from django.template import Context, Template
 from django.template.exceptions import TemplateSyntaxError
 from django.test import override_settings
 from django.test.client import RequestFactory
-from django.utils.six import StringIO
 from django.utils.timezone import now
 
 from combo.apps.assets.models import Asset
diff --git a/tests/test_pwa.py b/tests/test_pwa.py
index 78654692..fdf65881 100644
--- a/tests/test_pwa.py
+++ b/tests/test_pwa.py
@@ -1,5 +1,6 @@
 import base64
 from html.parser import HTMLParser
+from io import BytesIO
 from unittest import mock
 
 import pytest
@@ -9,7 +10,6 @@ from django.template import Context, Template
 from django.test import override_settings
 from django.test.client import RequestFactory
 from django.urls import reverse
-from django.utils.six import BytesIO
 from webtest import Upload
 
 from combo.apps.notifications.models import Notification
-- 
2.35.2

