Revert "Decorated instructor dashboard with sudo_required."
This commit is contained in:
@@ -5,7 +5,7 @@ django admin page for the course creators table
|
||||
from course_creators.models import CourseCreator, update_creator_state, send_user_notification, send_admin_notification
|
||||
from course_creators.views import update_course_creator_group
|
||||
|
||||
from django.contrib import admin
|
||||
from ratelimitbackend import admin
|
||||
from django.conf import settings
|
||||
from django.dispatch import receiver
|
||||
from edxmako.shortcuts import render_to_string
|
||||
|
||||
@@ -11,7 +11,6 @@ import mock
|
||||
from course_creators.admin import CourseCreatorAdmin
|
||||
from course_creators.models import CourseCreator
|
||||
from django.core import mail
|
||||
from sudo.utils import region_name
|
||||
from student.roles import CourseCreatorRole
|
||||
from student import auth
|
||||
|
||||
@@ -47,16 +46,6 @@ class CourseCreatorAdminTest(TestCase):
|
||||
"STUDIO_REQUEST_EMAIL": self.studio_request_email
|
||||
}
|
||||
|
||||
def grant_sudo_access(self, region, password):
|
||||
"""
|
||||
Grant sudo access to staff or instructor user.
|
||||
"""
|
||||
self.client.post(
|
||||
'/sudo/?region={}'.format(region_name(region)),
|
||||
{'password': password},
|
||||
follow=True
|
||||
)
|
||||
|
||||
@mock.patch('course_creators.admin.render_to_string', mock.Mock(side_effect=mock_render_to_string, autospec=True))
|
||||
@mock.patch('django.contrib.auth.models.User.email_user')
|
||||
def test_change_status(self, email_user):
|
||||
@@ -172,7 +161,6 @@ class CourseCreatorAdminTest(TestCase):
|
||||
self.assertFalse(self.creator_admin.has_change_permission(self.request))
|
||||
|
||||
def test_rate_limit_login(self):
|
||||
self.grant_sudo_access('django_admin', 'foo')
|
||||
with mock.patch.dict('django.conf.settings.FEATURES', {'ENABLE_CREATOR_GROUP': True}):
|
||||
post_params = {'username': self.user.username, 'password': 'wrong_password'}
|
||||
# try logging in 30 times, the default limit in the number of failed
|
||||
|
||||
Reference in New Issue
Block a user