Merge pull request #16774 from edx/jmbowman/PLAT-1801

PLAT-1801 Preserve new user login behavior under Django 1.10+
This commit is contained in:
Jeremy Bowman
2017-12-05 14:16:35 -05:00
committed by GitHub
33 changed files with 28 additions and 118 deletions

View File

@@ -41,13 +41,7 @@ class ThemeFilesystemLoader(FilesystemLoader):
if isinstance(theme_dirs, list):
template_dirs = theme_dirs + template_dirs
for template_dir in template_dirs:
try:
yield safe_join(template_dir, template_name)
except SuspiciousFileOperation:
# The joined path was located outside of this template_dir
# (it might be inside another one, so this isn't fatal).
pass
return list(super(ThemeFilesystemLoader, self).get_template_sources(template_name, template_dirs))
@staticmethod
def get_theme_template_sources():

View File

@@ -9,8 +9,9 @@ except for making it optional.
# possible, we should disable pylint so it doesn't complain about the violations
# that are already in that file
# pylint: skip-file
from django.template import Library, TemplateDoesNotExist
from django.template.base import (
TemplateSyntaxError, Library, token_kwargs, TemplateDoesNotExist
TemplateSyntaxError, token_kwargs
)
from django.template.loader_tags import IncludeNode

View File

@@ -409,7 +409,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
activate_account(u'invalid')
@skip_unless_lms
@pytest.mark.django111_expected_failure
def test_request_password_change(self):
# Create and activate an account
activation_key = create_account(self.USERNAME, self.PASSWORD, self.EMAIL)
@@ -428,7 +427,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
self.assertIsNot(result, None)
@skip_unless_lms
@pytest.mark.django111_expected_failure
def test_request_password_change_invalid_user(self):
with self.assertRaises(UserNotFound):
request_password_change(self.EMAIL, self.IS_SECURE)

View File

@@ -640,7 +640,7 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
self.assertEqual(1, len(pending_change))
activation_key = pending_change[0].activation_key
confirm_change_url = reverse(
"student.views.confirm_email_change", kwargs={'key': activation_key}
"confirm_email_change", kwargs={'key': activation_key}
)
response = self.client.post(confirm_change_url)
self.assertEqual(200, response.status_code)

View File

@@ -4,7 +4,6 @@ Test scenarios for the crowdsource hinter xblock.
import json
import unittest
import pytest
from django.conf import settings
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
@@ -136,7 +135,6 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@attr(shard=1)
@pytest.mark.django111_expected_failure
class TestHinterFunctions(TestCrowdsourceHinter):
"""
Check that the essential functions of the hinter work as expected.

View File

@@ -9,7 +9,6 @@ import StringIO
import unittest
from copy import deepcopy
import pytest
from django.conf import settings
from django.core.urlresolvers import reverse
@@ -197,7 +196,6 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@attr(shard=1)
@pytest.mark.django111_expected_failure
class TestRecommenderCreateFromEmpty(TestRecommender):
"""
Check whether we can add resources to an empty database correctly
@@ -258,7 +256,6 @@ class TestRecommenderResourceBase(TestRecommender):
@attr(shard=1)
@pytest.mark.django111_expected_failure
class TestRecommenderWithResources(TestRecommenderResourceBase):
"""
Check whether we can add/edit/flag/export resources correctly
@@ -425,7 +422,6 @@ class TestRecommenderWithResources(TestRecommenderResourceBase):
@attr(shard=1)
@ddt
@pytest.mark.django111_expected_failure
class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
"""
Check whether we can vote resources correctly
@@ -540,7 +536,6 @@ class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
@attr(shard=1)
@ddt
@pytest.mark.django111_expected_failure
class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
"""
Check whether we can remove/endorse resources correctly
@@ -636,7 +631,6 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
@attr(shard=1)
@ddt
@pytest.mark.django111_expected_failure
class TestRecommenderFileUploading(TestRecommender):
"""
Check whether we can handle file uploading correctly