python 3 compatibility
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
django admin page for the course creators table
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
from smtplib import SMTPException
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Table for storing information about whether or not Studio users have course creation privileges.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.db.models.signals import post_init, post_save
|
||||
|
||||
@@ -2,12 +2,15 @@
|
||||
Tests course_creators.admin.py.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import mock
|
||||
from django.contrib.admin.sites import AdminSite
|
||||
from django.contrib.auth.models import User
|
||||
from django.core import mail
|
||||
from django.http import HttpRequest
|
||||
from django.test import TestCase
|
||||
from six.moves import range
|
||||
|
||||
from course_creators.admin import CourseCreatorAdmin
|
||||
from course_creators.models import CourseCreator
|
||||
@@ -166,7 +169,7 @@ class CourseCreatorAdminTest(TestCase):
|
||||
post_params = {'username': self.user.username, 'password': 'wrong_password'}
|
||||
# try logging in 30 times, the default limit in the number of failed
|
||||
# login attempts in one 5 minute period before the rate gets limited
|
||||
for _ in xrange(30):
|
||||
for _ in range(30):
|
||||
response = self.client.post('/admin/login/', post_params)
|
||||
self.assertEquals(response.status_code, 200)
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
Tests course_creators.views.py.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import mock
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.urls import reverse
|
||||
from django.test import TestCase
|
||||
from django.urls import reverse
|
||||
|
||||
from course_creators.views import (
|
||||
add_user_with_status_granted,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""
|
||||
Methods for interacting programmatically with the user creator table.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
from course_creators.models import CourseCreator
|
||||
from student import auth
|
||||
from student.roles import CourseCreatorRole
|
||||
|
||||
Reference in New Issue
Block a user