ran modernize on openedx/core/djangoapps/util/tests and management

This commit is contained in:
Kyle Mulka
2019-05-06 16:41:25 +00:00
parent 06bc6fbd82
commit 9221c2dfd1
6 changed files with 15 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ Useful when paver or a shell script needs such a value.
This handles the one specific use case of the "print_settings" command from
django-extensions that we were actually using.
"""
from __future__ import print_function
from __future__ import absolute_import, print_function
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError

View File

@@ -12,7 +12,8 @@ django-extensions that we were actually using.
originally from http://www.djangosnippets.org/snippets/828/ by dnordberg
"""
from __future__ import print_function
from __future__ import absolute_import, print_function
import logging
import django

View File

@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import, unicode_literals
import pytest
from django.core.management import call_command, CommandError
from django.core.management import CommandError, call_command
def test_without_args(capsys):

View File

@@ -1,8 +1,10 @@
# pylint: disable=no-member, missing-docstring
from __future__ import absolute_import
from unittest import TestCase
from celery.task import task
from django.test.utils import override_settings
from edx_django_utils.cache import RequestCache

View File

@@ -2,8 +2,9 @@
Unit tests for user messages.
"""
import ddt
from __future__ import absolute_import
import ddt
from django.contrib.messages.middleware import MessageMiddleware
from django.test import RequestFactory, TestCase

View File

@@ -1,8 +1,12 @@
"""Tests for util.user_utils module."""
from __future__ import absolute_import
import unittest
import six
from django.contrib.auth.models import AnonymousUser
from ..user_utils import SystemUser
@@ -18,7 +22,7 @@ class SystemUserTestCase(unittest.TestCase):
self.assertIsNone(self.sysuser.id)
def test_system_user_has_custom_unicode_representation(self):
self.assertNotEqual(unicode(self.sysuser), unicode(AnonymousUser()))
self.assertNotEqual(six.text_type(self.sysuser), six.text_type(AnonymousUser()))
def test_system_user_is_not_staff(self):
self.assertFalse(self.sysuser.is_staff)