ran modernize on openedx/core/djangoapps/util/tests and management
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user