Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
103c723c
Commit
103c723c
authored
Dec 04, 2017
by
Jeremy Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PLAT-1801 Preserve new user login behavior under Django 1.10+
parent
08ca2110
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
28 additions
and
118 deletions
+28
-118
common/djangoapps/course_modes/tests/test_views.py
+0
-2
common/djangoapps/edxmako/makoloader.py
+2
-2
common/djangoapps/student/urls.py
+1
-1
common/djangoapps/student/views.py
+13
-2
lms/djangoapps/branding/tests/test_page.py
+5
-6
lms/djangoapps/course_api/blocks/serializers.py
+1
-1
lms/djangoapps/course_wiki/tests/test_middleware.py
+0
-2
lms/djangoapps/courseware/tests/test_about.py
+0
-8
lms/djangoapps/courseware/tests/test_access.py
+0
-3
lms/djangoapps/courseware/tests/test_course_info.py
+0
-5
lms/djangoapps/courseware/tests/test_course_survey.py
+0
-2
lms/djangoapps/courseware/tests/test_date_summary.py
+0
-2
lms/djangoapps/courseware/tests/test_entrance_exam.py
+0
-2
lms/djangoapps/courseware/tests/test_masquerade.py
+0
-5
lms/djangoapps/courseware/tests/test_module_render.py
+0
-9
lms/djangoapps/courseware/tests/test_navigation.py
+0
-2
lms/djangoapps/courseware/tests/test_password_history.py
+0
-2
lms/djangoapps/courseware/tests/test_split_module.py
+0
-3
lms/djangoapps/courseware/tests/test_submitting_problems.py
+0
-8
lms/djangoapps/courseware/tests/test_tabs.py
+0
-6
lms/djangoapps/courseware/tests/test_view_authentication.py
+0
-6
lms/djangoapps/courseware/tests/test_views.py
+0
-6
lms/djangoapps/courseware/tests/tests.py
+0
-3
lms/djangoapps/instructor/tests/test_api.py
+1
-5
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
+0
-3
lms/djangoapps/instructor_task/tests/test_integration.py
+0
-2
lms/templates/registration/password_reset_email.html
+1
-1
openedx/core/djangoapps/theming/template_loaders.py
+1
-7
openedx/core/djangoapps/theming/templatetags/optional_include.py
+2
-1
openedx/core/djangoapps/user_api/accounts/tests/test_api.py
+0
-2
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
+1
-1
openedx/tests/xblock_integration/test_crowdsource_hinter.py
+0
-2
openedx/tests/xblock_integration/test_recommender.py
+0
-6
No files found.
common/djangoapps/course_modes/tests/test_views.py
View file @
103c723c
...
@@ -9,7 +9,6 @@ from datetime import datetime, timedelta
...
@@ -9,7 +9,6 @@ from datetime import datetime, timedelta
import
ddt
import
ddt
import
freezegun
import
freezegun
import
httpretty
import
httpretty
import
pytest
import
pytz
import
pytz
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -69,7 +68,6 @@ class CourseModeViewTest(CatalogIntegrationMixin, UrlResetMixin, ModuleStoreTest
...
@@ -69,7 +68,6 @@ class CourseModeViewTest(CatalogIntegrationMixin, UrlResetMixin, ModuleStoreTest
(
False
,
None
,
False
,
False
),
(
False
,
None
,
False
,
False
),
)
)
@ddt.unpack
@ddt.unpack
@pytest.mark.django111_expected_failure
def
test_redirect_to_dashboard
(
self
,
is_active
,
enrollment_mode
,
redirect
,
has_started
):
def
test_redirect_to_dashboard
(
self
,
is_active
,
enrollment_mode
,
redirect
,
has_started
):
# Configure whether course has started
# Configure whether course has started
# If it has go to course home instead of dashboard
# If it has go to course home instead of dashboard
...
...
common/djangoapps/edxmako/makoloader.py
View file @
103c723c
...
@@ -2,8 +2,7 @@ import logging
...
@@ -2,8 +2,7 @@ import logging
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.exceptions
import
ImproperlyConfigured
from
django.template
import
Engine
,
engines
from
django.template
import
Engine
,
engines
,
TemplateDoesNotExist
from
django.template.base
import
TemplateDoesNotExist
from
django.template.loaders.app_directories
import
Loader
as
AppDirectoriesLoader
from
django.template.loaders.app_directories
import
Loader
as
AppDirectoriesLoader
from
django.template.loaders.filesystem
import
Loader
as
FilesystemLoader
from
django.template.loaders.filesystem
import
Loader
as
FilesystemLoader
...
@@ -22,6 +21,7 @@ class MakoLoader(object):
...
@@ -22,6 +21,7 @@ class MakoLoader(object):
"""
"""
is_usable
=
False
is_usable
=
False
supports_recursion
=
False
def
__init__
(
self
,
base_loader
):
def
__init__
(
self
,
base_loader
):
# base_loader is an instance of a BaseLoader subclass
# base_loader is an instance of a BaseLoader subclass
...
...
common/djangoapps/student/urls.py
View file @
103c723c
...
@@ -19,7 +19,7 @@ urlpatterns = [
...
@@ -19,7 +19,7 @@ urlpatterns = [
url
(
r'^login_ajax$'
,
student
.
views
.
login_user
,
name
=
"login"
),
url
(
r'^login_ajax$'
,
student
.
views
.
login_user
,
name
=
"login"
),
url
(
r'^login_ajax/(?P<error>[^/]*)$'
,
student
.
views
.
login_user
),
url
(
r'^login_ajax/(?P<error>[^/]*)$'
,
student
.
views
.
login_user
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
student
.
views
.
confirm_email_change
),
url
(
r'^email_confirm/(?P<key>[^/]*)$'
,
student
.
views
.
confirm_email_change
,
name
=
'confirm_email_change'
),
url
(
r'^create_account$'
,
student
.
views
.
create_account
,
name
=
'create_account'
),
url
(
r'^create_account$'
,
student
.
views
.
create_account
,
name
=
'create_account'
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
student
.
views
.
activate_account
,
name
=
"activate"
),
url
(
r'^activate/(?P<key>[^/]*)$'
,
student
.
views
.
activate_account
,
name
=
"activate"
),
...
...
common/djangoapps/student/views.py
View file @
103c723c
...
@@ -10,11 +10,12 @@ import warnings
...
@@ -10,11 +10,12 @@ import warnings
from
collections
import
defaultdict
,
namedtuple
from
collections
import
defaultdict
,
namedtuple
from
urlparse
import
parse_qs
,
urlsplit
,
urlunsplit
from
urlparse
import
parse_qs
,
urlsplit
,
urlunsplit
import
django
import
analytics
import
analytics
import
edx_oauth2_provider
import
edx_oauth2_provider
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib
import
messages
from
django.contrib
import
messages
from
django.contrib.auth
import
authenticate
,
login
,
logout
from
django.contrib.auth
import
authenticate
,
lo
ad_backend
,
lo
gin
,
logout
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.models
import
AnonymousUser
,
User
from
django.contrib.auth.models
import
AnonymousUser
,
User
from
django.contrib.auth.views
import
password_reset_confirm
from
django.contrib.auth.views
import
password_reset_confirm
...
@@ -147,6 +148,14 @@ REGISTRATION_UTM_CREATED_AT = 'registration_utm_created_at'
...
@@ -147,6 +148,14 @@ REGISTRATION_UTM_CREATED_AT = 'registration_utm_created_at'
# used to announce a registration
# used to announce a registration
REGISTER_USER
=
Signal
(
providing_args
=
[
"user"
,
"registration"
])
REGISTER_USER
=
Signal
(
providing_args
=
[
"user"
,
"registration"
])
# TODO: Remove Django 1.11 upgrade shim
# SHIM: Compensate for behavior change of default authentication backend in 1.10
if
django
.
VERSION
[
0
]
==
1
and
django
.
VERSION
[
1
]
<
10
:
NEW_USER_AUTH_BACKEND
=
'django.contrib.auth.backends.ModelBackend'
else
:
# We want to allow inactive users to log in only when their account is first created
NEW_USER_AUTH_BACKEND
=
'django.contrib.auth.backends.AllowAllUsersModelBackend'
# Disable this warning because it doesn't make sense to completely refactor tests to appease Pylint
# Disable this warning because it doesn't make sense to completely refactor tests to appease Pylint
# pylint: disable=logging-format-interpolation
# pylint: disable=logging-format-interpolation
...
@@ -2068,7 +2077,9 @@ def create_account_with_params(request, params):
...
@@ -2068,7 +2077,9 @@ def create_account_with_params(request, params):
# Immediately after a user creates an account, we log them in. They are only
# Immediately after a user creates an account, we log them in. They are only
# logged in until they close the browser. They can't log in again until they click
# logged in until they close the browser. They can't log in again until they click
# the activation link from the email.
# the activation link from the email.
new_user
=
authenticate
(
username
=
user
.
username
,
password
=
params
[
'password'
])
backend
=
load_backend
(
NEW_USER_AUTH_BACKEND
)
new_user
=
backend
.
authenticate
(
request
=
request
,
username
=
user
.
username
,
password
=
params
[
'password'
])
new_user
.
backend
=
NEW_USER_AUTH_BACKEND
login
(
request
,
new_user
)
login
(
request
,
new_user
)
request
.
session
.
set_expiry
(
0
)
request
.
session
.
set_expiry
(
0
)
...
...
lms/djangoapps/branding/tests/test_page.py
View file @
103c723c
...
@@ -157,7 +157,6 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, Mi
...
@@ -157,7 +157,6 @@ class PreRequisiteCourseCatalog(ModuleStoreTestCase, LoginEnrollmentTestCase, Mi
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
IndexPageCourseCardsSortingTests
(
ModuleStoreTestCase
):
class
IndexPageCourseCardsSortingTests
(
ModuleStoreTestCase
):
"""
"""
Test for Index page course cards sorting
Test for Index page course cards sorting
...
@@ -208,7 +207,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
...
@@ -208,7 +207,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
self
.
assertNotIn
(
'Search for a course'
,
response
.
content
)
self
.
assertNotIn
(
'Search for a course'
,
response
.
content
)
# check the /courses view
# check the /courses view
response
=
self
.
client
.
get
(
reverse
(
'
branding.views.
courses'
))
response
=
self
.
client
.
get
(
reverse
(
'courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is not present
# assert that the course discovery UI is not present
...
@@ -232,7 +231,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
...
@@ -232,7 +231,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
self
.
assertIn
(
'Search for a course'
,
response
.
content
)
self
.
assertIn
(
'Search for a course'
,
response
.
content
)
# check the /courses view
# check the /courses view
response
=
self
.
client
.
get
(
reverse
(
'
branding.views.
courses'
))
response
=
self
.
client
.
get
(
reverse
(
'courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
# assert that the course discovery UI is present
# assert that the course discovery UI is present
...
@@ -255,7 +254,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
...
@@ -255,7 +254,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
self
.
assertEqual
(
context
[
'courses'
][
2
]
.
id
,
self
.
course_with_default_start_date
.
id
)
self
.
assertEqual
(
context
[
'courses'
][
2
]
.
id
,
self
.
course_with_default_start_date
.
id
)
# check the /courses view
# check the /courses view
response
=
self
.
client
.
get
(
reverse
(
'
branding.views.
courses'
))
response
=
self
.
client
.
get
(
reverse
(
'courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
((
template
,
context
),
_
)
=
RENDER_MOCK
.
call_args
# pylint: disable=unpacking-non-sequence
((
template
,
context
),
_
)
=
RENDER_MOCK
.
call_args
# pylint: disable=unpacking-non-sequence
self
.
assertEqual
(
template
,
'courseware/courses.html'
)
self
.
assertEqual
(
template
,
'courseware/courses.html'
)
...
@@ -281,7 +280,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
...
@@ -281,7 +280,7 @@ class IndexPageCourseCardsSortingTests(ModuleStoreTestCase):
self
.
assertEqual
(
context
[
'courses'
][
2
]
.
id
,
self
.
course_with_default_start_date
.
id
)
self
.
assertEqual
(
context
[
'courses'
][
2
]
.
id
,
self
.
course_with_default_start_date
.
id
)
# check the /courses view as well
# check the /courses view as well
response
=
self
.
client
.
get
(
reverse
(
'
branding.views.
courses'
))
response
=
self
.
client
.
get
(
reverse
(
'courses'
))
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
((
template
,
context
),
_
)
=
RENDER_MOCK
.
call_args
# pylint: disable=unpacking-non-sequence
((
template
,
context
),
_
)
=
RENDER_MOCK
.
call_args
# pylint: disable=unpacking-non-sequence
self
.
assertEqual
(
template
,
'courseware/courses.html'
)
self
.
assertEqual
(
template
,
'courseware/courses.html'
)
...
@@ -301,7 +300,7 @@ class IndexPageProgramsTests(SiteMixin, ModuleStoreTestCase):
...
@@ -301,7 +300,7 @@ class IndexPageProgramsTests(SiteMixin, ModuleStoreTestCase):
def
test_get_programs_with_type_called
(
self
):
def
test_get_programs_with_type_called
(
self
):
views
=
[
views
=
[
(
reverse
(
'root'
),
'student.views.get_programs_with_type'
),
(
reverse
(
'root'
),
'student.views.get_programs_with_type'
),
(
reverse
(
'
branding.views.
courses'
),
'courseware.views.views.get_programs_with_type'
),
(
reverse
(
'courses'
),
'courseware.views.views.get_programs_with_type'
),
]
]
for
url
,
dotted_path
in
views
:
for
url
,
dotted_path
in
views
:
with
patch
(
dotted_path
)
as
mock_get_programs_with_type
:
with
patch
(
dotted_path
)
as
mock_get_programs_with_type
:
...
...
lms/djangoapps/course_api/blocks/serializers.py
View file @
103c723c
...
@@ -44,7 +44,7 @@ class BlockSerializer(serializers.Serializer): # pylint: disable=abstract-metho
...
@@ -44,7 +44,7 @@ class BlockSerializer(serializers.Serializer): # pylint: disable=abstract-metho
request
=
self
.
context
[
'request'
],
request
=
self
.
context
[
'request'
],
),
),
'student_view_url'
:
reverse
(
'student_view_url'
:
reverse
(
'
courseware.views.views.
render_xblock'
,
'render_xblock'
,
kwargs
=
{
'usage_key_string'
:
unicode
(
block_key
)},
kwargs
=
{
'usage_key_string'
:
unicode
(
block_key
)},
request
=
self
.
context
[
'request'
],
request
=
self
.
context
[
'request'
],
),
),
...
...
lms/djangoapps/course_wiki/tests/test_middleware.py
View file @
103c723c
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
Tests for wiki middleware.
Tests for wiki middleware.
"""
"""
import
pytest
from
django.test.client
import
Client
from
django.test.client
import
Client
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
wiki.models
import
URLPath
from
wiki.models
import
URLPath
...
@@ -14,7 +13,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -14,7 +13,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestWikiAccessMiddleware
(
ModuleStoreTestCase
):
class
TestWikiAccessMiddleware
(
ModuleStoreTestCase
):
"""Tests for WikiAccessMiddleware."""
"""Tests for WikiAccessMiddleware."""
...
...
lms/djangoapps/courseware/tests/test_about.py
View file @
103c723c
...
@@ -3,7 +3,6 @@ Test the about xblock
...
@@ -3,7 +3,6 @@ Test the about xblock
"""
"""
import
datetime
import
datetime
import
pytest
import
pytz
import
pytz
from
ccx_keys.locator
import
CCXLocator
from
ccx_keys.locator
import
CCXLocator
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -39,7 +38,6 @@ SHIB_ERROR_STR = "The currently logged-in user account does not have permission
...
@@ -39,7 +38,6 @@ SHIB_ERROR_STR = "The currently logged-in user account does not have permission
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
AboutTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
,
EventTrackingTestCase
,
MilestonesTestCaseMixin
):
class
AboutTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
,
EventTrackingTestCase
,
MilestonesTestCaseMixin
):
"""
"""
Tests about xblock.
Tests about xblock.
...
@@ -194,7 +192,6 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
...
@@ -194,7 +192,6 @@ class AboutTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase, EventTra
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
AboutTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
AboutTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the course about page
Tests for the course about page
...
@@ -243,7 +240,6 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -243,7 +240,6 @@ class AboutTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
AboutWithCappedEnrollmentsTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
AboutWithCappedEnrollmentsTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
This test case will check the About page when a course has a capped enrollment
This test case will check the About page when a course has a capped enrollment
...
@@ -291,7 +287,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleSt
...
@@ -291,7 +287,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, SharedModuleSt
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
AboutWithInvitationOnly
(
SharedModuleStoreTestCase
):
class
AboutWithInvitationOnly
(
SharedModuleStoreTestCase
):
"""
"""
This test case will check the About page when a course is invitation only.
This test case will check the About page when a course is invitation only.
...
@@ -339,7 +334,6 @@ class AboutWithInvitationOnly(SharedModuleStoreTestCase):
...
@@ -339,7 +334,6 @@ class AboutWithInvitationOnly(SharedModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@patch.dict
(
settings
.
FEATURES
,
{
'RESTRICT_ENROLL_BY_REG_METHOD'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'RESTRICT_ENROLL_BY_REG_METHOD'
:
True
})
@pytest.mark.django111_expected_failure
class
AboutTestCaseShibCourse
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
AboutTestCaseShibCourse
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
Test cases covering about page behavior for courses that use shib enrollment domain ("shib courses")
Test cases covering about page behavior for courses that use shib enrollment domain ("shib courses")
...
@@ -380,7 +374,6 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase
...
@@ -380,7 +374,6 @@ class AboutTestCaseShibCourse(LoginEnrollmentTestCase, SharedModuleStoreTestCase
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
AboutWithClosedEnrollment
(
ModuleStoreTestCase
):
class
AboutWithClosedEnrollment
(
ModuleStoreTestCase
):
"""
"""
This test case will check the About page for a course that has enrollment start/end
This test case will check the About page for a course that has enrollment start/end
...
@@ -426,7 +419,6 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
...
@@ -426,7 +419,6 @@ class AboutWithClosedEnrollment(ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SHOPPING_CART'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_SHOPPING_CART'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_PAID_COURSE_REGISTRATION'
:
True
})
@pytest.mark.django111_expected_failure
class
AboutPurchaseCourseTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
AboutPurchaseCourseTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
This test class runs through a suite of verifications regarding
This test class runs through a suite of verifications regarding
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
103c723c
...
@@ -6,7 +6,6 @@ import datetime
...
@@ -6,7 +6,6 @@ import datetime
import
itertools
import
itertools
import
ddt
import
ddt
import
pytest
import
pytz
import
pytz
from
ccx_keys.locator
import
CCXLocator
from
ccx_keys.locator
import
CCXLocator
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
...
@@ -159,7 +158,6 @@ class CoachAccessTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase)
...
@@ -159,7 +158,6 @@ class CoachAccessTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase)
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
AccessTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
class
AccessTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
"""
Tests for the various access controls on the student dashboard
Tests for the various access controls on the student dashboard
...
@@ -633,7 +631,6 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTes
...
@@ -633,7 +631,6 @@ class AccessTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, MilestonesTes
self
.
assertEqual
(
bool
(
access
.
_has_access_course
(
self
.
staff
,
'load_mobile'
,
descriptor
)),
staff_expected
)
self
.
assertEqual
(
bool
(
access
.
_has_access_course
(
self
.
staff
,
'load_mobile'
,
descriptor
)),
staff_expected
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENABLE_PREREQUISITE_COURSES'
:
True
,
'MILESTONES_APP'
:
True
})
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENABLE_PREREQUISITE_COURSES'
:
True
,
'MILESTONES_APP'
:
True
})
@pytest.mark.django111_expected_failure
def
test_courseware_page_unfulfilled_prereqs
(
self
):
def
test_courseware_page_unfulfilled_prereqs
(
self
):
"""
"""
Test courseware access when a course has pre-requisite course yet to be completed
Test courseware access when a course has pre-requisite course yet to be completed
...
...
lms/djangoapps/courseware/tests/test_course_info.py
View file @
103c723c
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
Test the course_info xblock
Test the course_info xblock
"""
"""
import
mock
import
mock
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.http
import
QueryDict
from
django.http
import
QueryDict
...
@@ -35,7 +34,6 @@ QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES
...
@@ -35,7 +34,6 @@ QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
CourseInfoTestCase
(
EnterpriseTestConsentRequired
,
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
CourseInfoTestCase
(
EnterpriseTestConsentRequired
,
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
Tests for the Course Info page
Tests for the Course Info page
...
@@ -145,7 +143,6 @@ class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase,
...
@@ -145,7 +143,6 @@ class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase,
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
CourseInfoLastAccessedTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
CourseInfoLastAccessedTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests of the CourseInfo last accessed link.
Tests of the CourseInfo last accessed link.
...
@@ -304,7 +301,6 @@ class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -304,7 +301,6 @@ class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
"""
"""
Tests for the Course Info page for an XML course
Tests for the Course Info page for an XML course
...
@@ -354,7 +350,6 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -354,7 +350,6 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@override_settings
(
FEATURES
=
dict
(
settings
.
FEATURES
,
EMBARGO
=
False
))
@override_settings
(
FEATURES
=
dict
(
settings
.
FEATURES
,
EMBARGO
=
False
))
@pytest.mark.django111_expected_failure
class
SelfPacedCourseInfoTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
SelfPacedCourseInfoTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
Tests for the info page of self-paced courses.
Tests for the info page of self-paced courses.
...
...
lms/djangoapps/courseware/tests/test_course_survey.py
View file @
103c723c
...
@@ -5,7 +5,6 @@ Python tests for the Survey workflows
...
@@ -5,7 +5,6 @@ Python tests for the Survey workflows
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
copy
import
deepcopy
from
copy
import
deepcopy
import
pytest
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
...
@@ -18,7 +17,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -18,7 +17,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
SurveyViewsTests
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
,
XssTestMixin
):
class
SurveyViewsTests
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
,
XssTestMixin
):
"""
"""
All tests for the views.py file
All tests for the views.py file
...
...
lms/djangoapps/courseware/tests/test_date_summary.py
View file @
103c723c
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
import
ddt
import
ddt
import
pytest
import
waffle
import
waffle
from
django.contrib.messages.middleware
import
MessageMiddleware
from
django.contrib.messages.middleware
import
MessageMiddleware
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -46,7 +45,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
...
@@ -46,7 +45,6 @@ from xmodule.modulestore.tests.factories import CourseFactory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
CourseDateSummaryTest
(
SharedModuleStoreTestCase
):
class
CourseDateSummaryTest
(
SharedModuleStoreTestCase
):
"""Tests for course date summary blocks."""
"""Tests for course date summary blocks."""
...
...
lms/djangoapps/courseware/tests/test_entrance_exam.py
View file @
103c723c
"""
"""
Tests use cases related to LMS Entrance Exam behavior, such as gated content access (TOC)
Tests use cases related to LMS Entrance Exam behavior, such as gated content access (TOC)
"""
"""
import
pytest
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
from
mock
import
Mock
,
patch
from
mock
import
Mock
,
patch
...
@@ -39,7 +38,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -39,7 +38,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
@attr
(
shard
=
2
)
@attr
(
shard
=
2
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENTRANCE_EXAMS'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENTRANCE_EXAMS'
:
True
})
@pytest.mark.django111_expected_failure
class
EntranceExamTestCases
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
class
EntranceExamTestCases
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
"""
Check that content is properly gated.
Check that content is properly gated.
...
...
lms/djangoapps/courseware/tests/test_masquerade.py
View file @
103c723c
...
@@ -5,7 +5,6 @@ import json
...
@@ -5,7 +5,6 @@ import json
import
pickle
import
pickle
from
datetime
import
datetime
from
datetime
import
datetime
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
from
django.test
import
TestCase
...
@@ -174,7 +173,6 @@ class NormalStudentVisibilityTest(MasqueradeTestCase):
...
@@ -174,7 +173,6 @@ class NormalStudentVisibilityTest(MasqueradeTestCase):
return
UserFactory
()
return
UserFactory
()
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_staff_debug_not_visible
(
self
):
def
test_staff_debug_not_visible
(
self
):
"""
"""
Tests that staff debug control is not present for a student.
Tests that staff debug control is not present for a student.
...
@@ -224,7 +222,6 @@ class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
...
@@ -224,7 +222,6 @@ class TestStaffMasqueradeAsStudent(StaffMasqueradeTestCase):
Check for staff being able to masquerade as student.
Check for staff being able to masquerade as student.
"""
"""
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_staff_debug_with_masquerade
(
self
):
def
test_staff_debug_with_masquerade
(
self
):
"""
"""
Tests that staff debug control is not visible when masquerading as a student.
Tests that staff debug control is not visible when masquerading as a student.
...
@@ -314,7 +311,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
...
@@ -314,7 +311,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
)
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_masquerade_as_specific_user_on_self_paced
(
self
):
def
test_masquerade_as_specific_user_on_self_paced
(
self
):
"""
"""
Test masquerading as a specific user for course info page when self paced configuration
Test masquerading as a specific user for course info page when self paced configuration
...
@@ -339,7 +335,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
...
@@ -339,7 +335,6 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi
self
.
assertIn
(
"OOGIE BLOOGIE"
,
content
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
content
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_masquerade_as_specific_student
(
self
):
def
test_masquerade_as_specific_student
(
self
):
"""
"""
Test masquerading as a specific user.
Test masquerading as a specific user.
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
103c723c
...
@@ -692,7 +692,6 @@ class TestHandleXBlockCallback(SharedModuleStoreTestCase, LoginEnrollmentTestCas
...
@@ -692,7 +692,6 @@ class TestHandleXBlockCallback(SharedModuleStoreTestCase, LoginEnrollmentTestCas
BlockCompletion
.
objects
.
get
(
block_key
=
block
.
scope_ids
.
usage_id
)
BlockCompletion
.
objects
.
get
(
block_key
=
block
.
scope_ids
.
usage_id
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_XBLOCK_VIEW_ENDPOINT'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_XBLOCK_VIEW_ENDPOINT'
:
True
})
@pytest.mark.django111_expected_failure
def
test_xblock_view_handler
(
self
):
def
test_xblock_view_handler
(
self
):
args
=
[
args
=
[
'edX/toy/2012_Fall'
,
'edX/toy/2012_Fall'
,
...
@@ -826,7 +825,6 @@ class TestTOC(ModuleStoreTestCase):
...
@@ -826,7 +825,6 @@ class TestTOC(ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_SPECIAL_EXAMS'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_SPECIAL_EXAMS'
:
True
})
@pytest.mark.django111_expected_failure
class
TestProctoringRendering
(
SharedModuleStoreTestCase
):
class
TestProctoringRendering
(
SharedModuleStoreTestCase
):
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
...
@@ -1242,7 +1240,6 @@ class TestGatedSubsectionRendering(SharedModuleStoreTestCase, MilestonesTestCase
...
@@ -1242,7 +1240,6 @@ class TestGatedSubsectionRendering(SharedModuleStoreTestCase, MilestonesTestCase
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
TestHtmlModifiers
(
ModuleStoreTestCase
):
class
TestHtmlModifiers
(
ModuleStoreTestCase
):
"""
"""
Tests to verify that standard modifications to the output of XModule/XBlock
Tests to verify that standard modifications to the output of XModule/XBlock
...
@@ -1407,7 +1404,6 @@ class XBlockWithJsonInitData(XBlock):
...
@@ -1407,7 +1404,6 @@ class XBlockWithJsonInitData(XBlock):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
JsonInitDataTest
(
ModuleStoreTestCase
):
class
JsonInitDataTest
(
ModuleStoreTestCase
):
"""Tests for JSON data injected into the JS init function."""
"""Tests for JSON data injected into the JS init function."""
...
@@ -1492,7 +1488,6 @@ class ViewInStudioTest(ModuleStoreTestCase):
...
@@ -1492,7 +1488,6 @@ class ViewInStudioTest(ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
MongoViewInStudioTest
(
ViewInStudioTest
):
class
MongoViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in a mongo backed course."""
"""Test the 'View in Studio' link visibility in a mongo backed course."""
...
@@ -1522,7 +1517,6 @@ class MongoViewInStudioTest(ViewInStudioTest):
...
@@ -1522,7 +1517,6 @@ class MongoViewInStudioTest(ViewInStudioTest):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
MixedViewInStudioTest
(
ViewInStudioTest
):
class
MixedViewInStudioTest
(
ViewInStudioTest
):
"""Test the 'View in Studio' link visibility in a mixed mongo backed course."""
"""Test the 'View in Studio' link visibility in a mixed mongo backed course."""
...
@@ -1557,7 +1551,6 @@ class DetachedXBlock(XBlock):
...
@@ -1557,7 +1551,6 @@ class DetachedXBlock(XBlock):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISPLAY_DEBUG_INFO_TO_STAFF'
:
True
,
'DISPLAY_HISTOGRAMS_TO_STAFF'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISPLAY_DEBUG_INFO_TO_STAFF'
:
True
,
'DISPLAY_HISTOGRAMS_TO_STAFF'
:
True
})
@patch
(
'courseware.module_render.has_access'
,
Mock
(
return_value
=
True
,
autospec
=
True
))
@patch
(
'courseware.module_render.has_access'
,
Mock
(
return_value
=
True
,
autospec
=
True
))
@pytest.mark.django111_expected_failure
class
TestStaffDebugInfo
(
SharedModuleStoreTestCase
):
class
TestStaffDebugInfo
(
SharedModuleStoreTestCase
):
"""Tests to verify that Staff Debug Info panel and histograms are displayed to staff."""
"""Tests to verify that Staff Debug Info panel and histograms are displayed to staff."""
...
@@ -1905,7 +1898,6 @@ class TestModuleTrackingContext(SharedModuleStoreTestCase):
...
@@ -1905,7 +1898,6 @@ class TestModuleTrackingContext(SharedModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestXmoduleRuntimeEvent
(
TestSubmittingProblems
):
class
TestXmoduleRuntimeEvent
(
TestSubmittingProblems
):
"""
"""
Inherit from TestSubmittingProblems to get functionality that set up a course and problems structure
Inherit from TestSubmittingProblems to get functionality that set up a course and problems structure
...
@@ -1975,7 +1967,6 @@ class TestXmoduleRuntimeEvent(TestSubmittingProblems):
...
@@ -1975,7 +1967,6 @@ class TestXmoduleRuntimeEvent(TestSubmittingProblems):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestRebindModule
(
TestSubmittingProblems
):
class
TestRebindModule
(
TestSubmittingProblems
):
"""
"""
Tests to verify the functionality of rebinding a module.
Tests to verify the functionality of rebinding a module.
...
...
lms/djangoapps/courseware/tests/test_navigation.py
View file @
103c723c
...
@@ -3,7 +3,6 @@ This test file will run through some LMS test scenarios regarding access and nav
...
@@ -3,7 +3,6 @@ This test file will run through some LMS test scenarios regarding access and nav
"""
"""
import
time
import
time
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
...
@@ -21,7 +20,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
...
@@ -21,7 +20,6 @@ from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestNavigation
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
):
class
TestNavigation
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
"""
Check that navigation state is saved properly.
Check that navigation state is saved properly.
...
...
lms/djangoapps/courseware/tests/test_password_history.py
View file @
103c723c
...
@@ -6,7 +6,6 @@ from datetime import timedelta
...
@@ -6,7 +6,6 @@ from datetime import timedelta
from
uuid
import
uuid4
from
uuid
import
uuid4
import
ddt
import
ddt
import
pytest
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.contrib.auth.tokens
import
default_token_generator
from
django.contrib.auth.tokens
import
default_token_generator
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -24,7 +23,6 @@ from student.models import PasswordHistory
...
@@ -24,7 +23,6 @@ from student.models import PasswordHistory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ADVANCED_SECURITY'
:
True
})
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ADVANCED_SECURITY'
:
True
})
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
TestPasswordHistory
(
LoginEnrollmentTestCase
):
class
TestPasswordHistory
(
LoginEnrollmentTestCase
):
"""
"""
Go through some of the PasswordHistory use cases
Go through some of the PasswordHistory use cases
...
...
lms/djangoapps/courseware/tests/test_split_module.py
View file @
103c723c
"""
"""
Test for split test XModule
Test for split test XModule
"""
"""
import
pytest
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
MagicMock
from
mock
import
MagicMock
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
...
@@ -143,7 +142,6 @@ class SplitTestBase(SharedModuleStoreTestCase):
...
@@ -143,7 +142,6 @@ class SplitTestBase(SharedModuleStoreTestCase):
self
.
assertIn
(
visible
,
content
)
self
.
assertIn
(
visible
,
content
)
@pytest.mark.django111_expected_failure
class
TestSplitTestVert
(
SplitTestBase
):
class
TestSplitTestVert
(
SplitTestBase
):
"""
"""
Tests a sequential whose top-level vertical is determined by a split test.
Tests a sequential whose top-level vertical is determined by a split test.
...
@@ -212,7 +210,6 @@ class TestSplitTestVert(SplitTestBase):
...
@@ -212,7 +210,6 @@ class TestSplitTestVert(SplitTestBase):
]
]
@pytest.mark.django111_expected_failure
class
TestVertSplitTestVert
(
SplitTestBase
):
class
TestVertSplitTestVert
(
SplitTestBase
):
"""
"""
Tests a sequential whose top-level vertical contains a split test determining content within that vertical.
Tests a sequential whose top-level vertical contains a split test determining content within that vertical.
...
...
lms/djangoapps/courseware/tests/test_submitting_problems.py
View file @
103c723c
...
@@ -10,7 +10,6 @@ import os
...
@@ -10,7 +10,6 @@ import os
from
textwrap
import
dedent
from
textwrap
import
dedent
import
ddt
import
ddt
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -337,7 +336,6 @@ class TestCourseGrades(TestSubmittingProblems):
...
@@ -337,7 +336,6 @@ class TestCourseGrades(TestSubmittingProblems):
@attr
(
shard
=
3
)
@attr
(
shard
=
3
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
TestCourseGrader
(
TestSubmittingProblems
):
class
TestCourseGrader
(
TestSubmittingProblems
):
"""
"""
Suite of tests for the course grader.
Suite of tests for the course grader.
...
@@ -781,7 +779,6 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
...
@@ -781,7 +779,6 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
# re-fetch the course from the database so the object is up to date
# re-fetch the course from the database so the object is up to date
self
.
refresh_course
()
self
.
refresh_course
()
@pytest.mark.django111_expected_failure
def
test_three_files
(
self
):
def
test_three_files
(
self
):
# Open the test files, and arrange to close them later.
# Open the test files, and arrange to close them later.
filenames
=
"prog1.py prog2.py prog3.py"
filenames
=
"prog1.py prog2.py prog3.py"
...
@@ -810,7 +807,6 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
...
@@ -810,7 +807,6 @@ class ProblemWithUploadedFilesTest(TestSubmittingProblems):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestPythonGradedResponse
(
TestSubmittingProblems
):
class
TestPythonGradedResponse
(
TestSubmittingProblems
):
"""
"""
Check that we can submit a schematic and custom response, and it answers properly.
Check that we can submit a schematic and custom response, and it answers properly.
...
@@ -1178,7 +1174,6 @@ class TestConditionalContent(TestSubmittingProblems):
...
@@ -1178,7 +1174,6 @@ class TestConditionalContent(TestSubmittingProblems):
# Submit answers for problem in Section 1, which is visible to all students.
# Submit answers for problem in Section 1, which is visible to all students.
self
.
submit_question_answer
(
'H1P1'
,
{
'2_1'
:
'Correct'
,
'2_2'
:
'Incorrect'
})
self
.
submit_question_answer
(
'H1P1'
,
{
'2_1'
:
'Correct'
,
'2_2'
:
'Incorrect'
})
@pytest.mark.django111_expected_failure
def
test_split_different_problems_group_0
(
self
):
def
test_split_different_problems_group_0
(
self
):
"""
"""
Tests that users who see different problems in a split_test module instance are graded correctly.
Tests that users who see different problems in a split_test module instance are graded correctly.
...
@@ -1198,7 +1193,6 @@ class TestConditionalContent(TestSubmittingProblems):
...
@@ -1198,7 +1193,6 @@ class TestConditionalContent(TestSubmittingProblems):
homework_2_score
=
(
1.0
+
2.0
)
/
4
homework_2_score
=
(
1.0
+
2.0
)
/
4
self
.
check_grade_percent
(
round
((
homework_1_score
+
homework_2_score
)
/
2
,
2
))
self
.
check_grade_percent
(
round
((
homework_1_score
+
homework_2_score
)
/
2
,
2
))
@pytest.mark.django111_expected_failure
def
test_split_different_problems_group_1
(
self
):
def
test_split_different_problems_group_1
(
self
):
"""
"""
Tests that users who see different problems in a split_test module instance are graded correctly.
Tests that users who see different problems in a split_test module instance are graded correctly.
...
@@ -1235,7 +1229,6 @@ class TestConditionalContent(TestSubmittingProblems):
...
@@ -1235,7 +1229,6 @@ class TestConditionalContent(TestSubmittingProblems):
self
.
submit_question_answer
(
'H1P1'
,
{
'2_1'
:
'Correct'
})
self
.
submit_question_answer
(
'H1P1'
,
{
'2_1'
:
'Correct'
})
@pytest.mark.django111_expected_failure
def
test_split_one_group_no_problems_group_0
(
self
):
def
test_split_one_group_no_problems_group_0
(
self
):
"""
"""
Tests what happens when a given group has no problems in it (students receive 0 for that section).
Tests what happens when a given group has no problems in it (students receive 0 for that section).
...
@@ -1251,7 +1244,6 @@ class TestConditionalContent(TestSubmittingProblems):
...
@@ -1251,7 +1244,6 @@ class TestConditionalContent(TestSubmittingProblems):
homework_2_score
=
0.0
homework_2_score
=
0.0
self
.
check_grade_percent
(
round
((
homework_1_score
+
homework_2_score
)
/
2
,
2
))
self
.
check_grade_percent
(
round
((
homework_1_score
+
homework_2_score
)
/
2
,
2
))
@pytest.mark.django111_expected_failure
def
test_split_one_group_no_problems_group_1
(
self
):
def
test_split_one_group_no_problems_group_1
(
self
):
"""
"""
Verifies students in the group that DOES have a problem receive a score for their problem.
Verifies students in the group that DOES have a problem receive a score for their problem.
...
...
lms/djangoapps/courseware/tests/test_tabs.py
View file @
103c723c
...
@@ -246,7 +246,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
...
@@ -246,7 +246,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
cls
.
course
.
tabs
.
append
(
xmodule_tabs
.
CourseTab
.
load
(
'static_tab'
,
name
=
'New Tab'
,
url_slug
=
'new_tab'
))
cls
.
course
.
tabs
.
append
(
xmodule_tabs
.
CourseTab
.
load
(
'static_tab'
,
name
=
'New Tab'
,
url_slug
=
'new_tab'
))
cls
.
course
.
save
()
cls
.
course
.
save
()
@pytest.mark.django111_expected_failure
def
test_logged_in
(
self
):
def
test_logged_in
(
self
):
self
.
setup_user
()
self
.
setup_user
()
url
=
reverse
(
'static_tab'
,
args
=
[
self
.
course
.
id
.
to_deprecated_string
(),
'new_tab'
])
url
=
reverse
(
'static_tab'
,
args
=
[
self
.
course
.
id
.
to_deprecated_string
(),
'new_tab'
])
...
@@ -260,14 +259,12 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
...
@@ -260,14 +259,12 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
@pytest.mark.django111_expected_failure
def
test_invalid_course_key
(
self
):
def
test_invalid_course_key
(
self
):
self
.
setup_user
()
self
.
setup_user
()
request
=
get_mock_request
(
self
.
user
)
request
=
get_mock_request
(
self
.
user
)
with
self
.
assertRaises
(
Http404
):
with
self
.
assertRaises
(
Http404
):
StaticCourseTabView
()
.
get
(
request
,
course_id
=
'edX/toy'
,
tab_slug
=
'new_tab'
)
StaticCourseTabView
()
.
get
(
request
,
course_id
=
'edX/toy'
,
tab_slug
=
'new_tab'
)
@pytest.mark.django111_expected_failure
def
test_get_static_tab_fragment
(
self
):
def
test_get_static_tab_fragment
(
self
):
self
.
setup_user
()
self
.
setup_user
()
course
=
get_course_by_id
(
self
.
course
.
id
)
course
=
get_course_by_id
(
self
.
course
.
id
)
...
@@ -323,7 +320,6 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -323,7 +320,6 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
xml_url
=
"8e4cce2b4aaf4ba28b1220804619e41f"
self
.
xml_url
=
"8e4cce2b4aaf4ba28b1220804619e41f"
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_logged_in_xml
(
self
):
def
test_logged_in_xml
(
self
):
self
.
setup_user
()
self
.
setup_user
()
url
=
reverse
(
'static_tab'
,
args
=
[
self
.
xml_course_key
.
to_deprecated_string
(),
self
.
xml_url
])
url
=
reverse
(
'static_tab'
,
args
=
[
self
.
xml_course_key
.
to_deprecated_string
(),
self
.
xml_url
])
...
@@ -341,7 +337,6 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -341,7 +337,6 @@ class StaticTabDateTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENTRANCE_EXAMS'
:
True
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENTRANCE_EXAMS'
:
True
})
@pytest.mark.django111_expected_failure
class
EntranceExamsTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
class
EntranceExamsTabsTestCase
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
,
MilestonesTestCaseMixin
):
"""
"""
Validate tab behavior when dealing with Entrance Exams
Validate tab behavior when dealing with Entrance Exams
...
@@ -449,7 +444,6 @@ class EntranceExamsTabsTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, Mi
...
@@ -449,7 +444,6 @@ class EntranceExamsTabsTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase, Mi
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TextBookCourseViewsTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
class
TextBookCourseViewsTestCase
(
LoginEnrollmentTestCase
,
SharedModuleStoreTestCase
):
"""
"""
Validate tab behavior when dealing with textbooks.
Validate tab behavior when dealing with textbooks.
...
...
lms/djangoapps/courseware/tests/test_view_authentication.py
View file @
103c723c
import
datetime
import
datetime
import
pytz
import
pytz
import
pytest
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
patch
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
...
@@ -164,7 +163,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
...
@@ -164,7 +163,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
self
.
org_staff_user
=
OrgStaffFactory
(
course_key
=
self
.
course
.
id
)
self
.
org_staff_user
=
OrgStaffFactory
(
course_key
=
self
.
course
.
id
)
self
.
org_instructor_user
=
OrgInstructorFactory
(
course_key
=
self
.
course
.
id
)
self
.
org_instructor_user
=
OrgInstructorFactory
(
course_key
=
self
.
course
.
id
)
@pytest.mark.django111_expected_failure
def
test_redirection_unenrolled
(
self
):
def
test_redirection_unenrolled
(
self
):
"""
"""
Verify unenrolled student is redirected to the 'about' section of the chapter
Verify unenrolled student is redirected to the 'about' section of the chapter
...
@@ -181,7 +179,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
...
@@ -181,7 +179,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
)
)
)
)
@pytest.mark.django111_expected_failure
def
test_redirection_enrolled
(
self
):
def
test_redirection_enrolled
(
self
):
"""
"""
Verify enrolled student is redirected to the 'Welcome' section of
Verify enrolled student is redirected to the 'Welcome' section of
...
@@ -305,7 +302,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
...
@@ -305,7 +302,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
self
.
assert_request_status_code
(
200
,
url
)
self
.
assert_request_status_code
(
200
,
url
)
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_dark_launch_enrolled_student
(
self
):
def
test_dark_launch_enrolled_student
(
self
):
"""
"""
Make sure that before course start, students can't access course
Make sure that before course start, students can't access course
...
@@ -333,7 +329,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
...
@@ -333,7 +329,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
self
.
_check_non_staff_dark
(
self
.
test_course
)
self
.
_check_non_staff_dark
(
self
.
test_course
)
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_dark_launch_instructor
(
self
):
def
test_dark_launch_instructor
(
self
):
"""
"""
Make sure that before course start instructors can access the
Make sure that before course start instructors can access the
...
@@ -357,7 +352,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
...
@@ -357,7 +352,6 @@ class TestViewAuth(EnterpriseTestConsentRequired, ModuleStoreTestCase, LoginEnro
self
.
_check_non_staff_dark
(
self
.
test_course
)
self
.
_check_non_staff_dark
(
self
.
test_course
)
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'courseware.access.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@pytest.mark.django111_expected_failure
def
test_dark_launch_global_staff
(
self
):
def
test_dark_launch_global_staff
(
self
):
"""
"""
Make sure that before course start staff can access
Make sure that before course start staff can access
...
...
lms/djangoapps/courseware/tests/test_views.py
View file @
103c723c
...
@@ -210,7 +210,6 @@ class TestJumpTo(ModuleStoreTestCase):
...
@@ -210,7 +210,6 @@ class TestJumpTo(ModuleStoreTestCase):
@attr
(
shard
=
2
)
@attr
(
shard
=
2
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
IndexQueryTestCase
(
ModuleStoreTestCase
):
class
IndexQueryTestCase
(
ModuleStoreTestCase
):
"""
"""
Tests for query count.
Tests for query count.
...
@@ -253,7 +252,6 @@ class IndexQueryTestCase(ModuleStoreTestCase):
...
@@ -253,7 +252,6 @@ class IndexQueryTestCase(ModuleStoreTestCase):
@attr
(
shard
=
2
)
@attr
(
shard
=
2
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
ViewsTestCase
(
ModuleStoreTestCase
):
class
ViewsTestCase
(
ModuleStoreTestCase
):
"""
"""
Tests for views.py methods.
Tests for views.py methods.
...
@@ -1117,7 +1115,6 @@ class TestProgressDueDate(BaseDueDateTests):
...
@@ -1117,7 +1115,6 @@ class TestProgressDueDate(BaseDueDateTests):
# TODO: LEARNER-71: Delete entire TestAccordionDueDate class
# TODO: LEARNER-71: Delete entire TestAccordionDueDate class
@pytest.mark.django111_expected_failure
class
TestAccordionDueDate
(
BaseDueDateTests
):
class
TestAccordionDueDate
(
BaseDueDateTests
):
"""
"""
Test that the accordion page displays due dates correctly
Test that the accordion page displays due dates correctly
...
@@ -1190,7 +1187,6 @@ class StartDateTests(ModuleStoreTestCase):
...
@@ -1190,7 +1187,6 @@ class StartDateTests(ModuleStoreTestCase):
@patch
(
'util.date_utils.ugettext'
,
fake_ugettext
(
translations
=
{
@patch
(
'util.date_utils.ugettext'
,
fake_ugettext
(
translations
=
{
"SHORT_DATE_FORMAT"
:
"
%
Y-
%
b-
%
d"
,
"SHORT_DATE_FORMAT"
:
"
%
Y-
%
b-
%
d"
,
}))
}))
@pytest.mark.django111_expected_failure
def
test_format_localized_in_studio_course
(
self
):
def
test_format_localized_in_studio_course
(
self
):
course
=
self
.
set_up_course
()
course
=
self
.
set_up_course
()
response
=
self
.
get_about_response
(
course
.
id
)
response
=
self
.
get_about_response
(
course
.
id
)
...
@@ -2198,7 +2194,6 @@ class ViewCheckerBlock(XBlock):
...
@@ -2198,7 +2194,6 @@ class ViewCheckerBlock(XBlock):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
TestIndexView
(
ModuleStoreTestCase
):
class
TestIndexView
(
ModuleStoreTestCase
):
"""
"""
Tests of the courseware.views.index view.
Tests of the courseware.views.index view.
...
@@ -2536,7 +2531,6 @@ class TestIndexViewCrawlerStudentStateWrites(SharedModuleStoreTestCase):
...
@@ -2536,7 +2531,6 @@ class TestIndexViewCrawlerStudentStateWrites(SharedModuleStoreTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
EnterpriseConsentTestCase
(
EnterpriseTestConsentRequired
,
ModuleStoreTestCase
):
class
EnterpriseConsentTestCase
(
EnterpriseTestConsentRequired
,
ModuleStoreTestCase
):
"""
"""
Ensure that the Enterprise Data Consent redirects are in place only when consent is required.
Ensure that the Enterprise Data Consent redirects are in place only when consent is required.
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
103c723c
...
@@ -5,7 +5,6 @@ from textwrap import dedent
...
@@ -5,7 +5,6 @@ from textwrap import dedent
from
unittest
import
TestCase
from
unittest
import
TestCase
import
mock
import
mock
import
pytest
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
...
@@ -19,7 +18,6 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
...
@@ -19,7 +18,6 @@ from xmodule.modulestore.tests.factories import ToyCourseFactory
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
ActivateLoginTest
(
LoginEnrollmentTestCase
):
class
ActivateLoginTest
(
LoginEnrollmentTestCase
):
"""
"""
Test logging in and logging out.
Test logging in and logging out.
...
@@ -124,7 +122,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
...
@@ -124,7 +122,6 @@ class PageLoaderTestCase(LoginEnrollmentTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestMongoCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
class
TestMongoCoursesLoad
(
ModuleStoreTestCase
,
PageLoaderTestCase
):
"""
"""
Check that all pages in test courses load properly from Mongo.
Check that all pages in test courses load properly from Mongo.
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
103c723c
...
@@ -2376,7 +2376,7 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
...
@@ -2376,7 +2376,7 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
"""
"""
enroll user using a registration code
enroll user using a registration code
"""
"""
redeem_url
=
reverse
(
'
shoppingcart.views.
register_code_redemption'
,
args
=
[
code
],
is_dashboard_endpoint
=
False
)
redeem_url
=
reverse
(
'register_code_redemption'
,
args
=
[
code
],
is_dashboard_endpoint
=
False
)
self
.
client
.
login
(
username
=
user
.
username
,
password
=
'test'
)
self
.
client
.
login
(
username
=
user
.
username
,
password
=
'test'
)
response
=
self
.
client
.
get
(
redeem_url
)
response
=
self
.
client
.
get
(
redeem_url
)
self
.
assertEquals
(
response
.
status_code
,
200
)
self
.
assertEquals
(
response
.
status_code
,
200
)
...
@@ -2871,7 +2871,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
...
@@ -2871,7 +2871,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
decorated_func
(
request
,
self
.
course
.
id
.
to_deprecated_string
())
decorated_func
(
request
,
self
.
course
.
id
.
to_deprecated_string
())
self
.
assertTrue
(
func
.
called
)
self
.
assertTrue
(
func
.
called
)
@pytest.mark.django111_expected_failure
def
test_enrollment_report_features_csv
(
self
):
def
test_enrollment_report_features_csv
(
self
):
"""
"""
test to generate enrollment report.
test to generate enrollment report.
...
@@ -2912,7 +2911,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
...
@@ -2912,7 +2911,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
response
=
self
.
client
.
post
(
url
,
{})
response
=
self
.
client
.
post
(
url
,
{})
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
@pytest.mark.django111_expected_failure
def
test_bulk_purchase_detailed_report
(
self
):
def
test_bulk_purchase_detailed_report
(
self
):
"""
"""
test to generate detailed enrollment report.
test to generate detailed enrollment report.
...
@@ -2968,7 +2966,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
...
@@ -2968,7 +2966,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
response
=
self
.
client
.
post
(
url
,
{})
response
=
self
.
client
.
post
(
url
,
{})
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
@pytest.mark.django111_expected_failure
def
test_create_registration_code_without_invoice_and_order
(
self
):
def
test_create_registration_code_without_invoice_and_order
(
self
):
"""
"""
test generate detailed enrollment report,
test generate detailed enrollment report,
...
@@ -2991,7 +2988,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
...
@@ -2991,7 +2988,6 @@ class TestInstructorAPILevelsDataDump(SharedModuleStoreTestCase, LoginEnrollment
response
=
self
.
client
.
post
(
url
,
{})
response
=
self
.
client
.
post
(
url
,
{})
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
self
.
assertIn
(
'The detailed enrollment report is being created.'
,
response
.
content
)
@pytest.mark.django111_expected_failure
def
test_invoice_payment_is_still_pending_for_registration_codes
(
self
):
def
test_invoice_payment_is_still_pending_for_registration_codes
(
self
):
"""
"""
test generate enrollment report
test generate enrollment report
...
...
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
View file @
103c723c
...
@@ -4,7 +4,6 @@ Unit tests for instructor_dashboard.py.
...
@@ -4,7 +4,6 @@ Unit tests for instructor_dashboard.py.
import
datetime
import
datetime
import
ddt
import
ddt
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.test.client
import
RequestFactory
from
django.test.client
import
RequestFactory
...
@@ -321,7 +320,6 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
...
@@ -321,7 +320,6 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
# Max number of student per page is one. Patched setting MAX_STUDENTS_PER_PAGE_GRADE_BOOK = 1
# Max number of student per page is one. Patched setting MAX_STUDENTS_PER_PAGE_GRADE_BOOK = 1
self
.
assertEqual
(
len
(
response
.
mako_context
[
'students'
]),
1
)
# pylint: disable=no-member
self
.
assertEqual
(
len
(
response
.
mako_context
[
'students'
]),
1
)
# pylint: disable=no-member
@pytest.mark.django111_expected_failure
def
test_open_response_assessment_page
(
self
):
def
test_open_response_assessment_page
(
self
):
"""
"""
Test that Open Responses is available only if course contains at least one ORA block
Test that Open Responses is available only if course contains at least one ORA block
...
@@ -341,7 +339,6 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
...
@@ -341,7 +339,6 @@ class TestInstructorDashboard(ModuleStoreTestCase, LoginEnrollmentTestCase, XssT
response
=
self
.
client
.
get
(
self
.
url
)
response
=
self
.
client
.
get
(
self
.
url
)
self
.
assertIn
(
ora_section
,
response
.
content
)
self
.
assertIn
(
ora_section
,
response
.
content
)
@pytest.mark.django111_expected_failure
def
test_open_response_assessment_page_orphan
(
self
):
def
test_open_response_assessment_page_orphan
(
self
):
"""
"""
Tests that the open responses tab loads if the course contains an
Tests that the open responses tab loads if the course contains an
...
...
lms/djangoapps/instructor_task/tests/test_integration.py
View file @
103c723c
...
@@ -11,7 +11,6 @@ import textwrap
...
@@ -11,7 +11,6 @@ import textwrap
from
collections
import
namedtuple
from
collections
import
namedtuple
import
ddt
import
ddt
import
pytest
from
celery.states
import
FAILURE
,
SUCCESS
from
celery.states
import
FAILURE
,
SUCCESS
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -68,7 +67,6 @@ class TestIntegrationTask(InstructorTaskModuleTestCase):
...
@@ -68,7 +67,6 @@ class TestIntegrationTask(InstructorTaskModuleTestCase):
@attr
(
shard
=
3
)
@attr
(
shard
=
3
)
@ddt.ddt
@ddt.ddt
@pytest.mark.django111_expected_failure
class
TestRescoringTask
(
TestIntegrationTask
):
class
TestRescoringTask
(
TestIntegrationTask
):
"""
"""
Integration-style tests for rescoring problems in a background task.
Integration-style tests for rescoring problems in a background task.
...
...
lms/templates/registration/password_reset_email.html
View file @
103c723c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
{% trans "Please go to the following page and choose a new password:" %}
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{% block reset_link %}
{{ protocol }}://{{ site_name }}{% url '
student.views.password_reset_confirm_wrapper
' uidb36=uid token=token %}
{{ protocol }}://{{ site_name }}{% url '
password_reset_confirm
' uidb36=uid token=token %}
{% endblock %}
{% endblock %}
{% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." %}
{% trans "If you didn't request this change, you can disregard this email - we have not yet reset your password." %}
...
...
openedx/core/djangoapps/theming/template_loaders.py
View file @
103c723c
...
@@ -41,13 +41,7 @@ class ThemeFilesystemLoader(FilesystemLoader):
...
@@ -41,13 +41,7 @@ class ThemeFilesystemLoader(FilesystemLoader):
if
isinstance
(
theme_dirs
,
list
):
if
isinstance
(
theme_dirs
,
list
):
template_dirs
=
theme_dirs
+
template_dirs
template_dirs
=
theme_dirs
+
template_dirs
for
template_dir
in
template_dirs
:
return
list
(
super
(
ThemeFilesystemLoader
,
self
)
.
get_template_sources
(
template_name
,
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
@staticmethod
@staticmethod
def
get_theme_template_sources
():
def
get_theme_template_sources
():
...
...
openedx/core/djangoapps/theming/templatetags/optional_include.py
View file @
103c723c
...
@@ -9,8 +9,9 @@ except for making it optional.
...
@@ -9,8 +9,9 @@ except for making it optional.
# possible, we should disable pylint so it doesn't complain about the violations
# possible, we should disable pylint so it doesn't complain about the violations
# that are already in that file
# that are already in that file
# pylint: skip-file
# pylint: skip-file
from
django.template
import
Library
,
TemplateDoesNotExist
from
django.template.base
import
(
from
django.template.base
import
(
TemplateSyntaxError
,
Library
,
token_kwargs
,
TemplateDoesNotExist
TemplateSyntaxError
,
token_kwargs
)
)
from
django.template.loader_tags
import
IncludeNode
from
django.template.loader_tags
import
IncludeNode
...
...
openedx/core/djangoapps/user_api/accounts/tests/test_api.py
View file @
103c723c
...
@@ -409,7 +409,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
...
@@ -409,7 +409,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
activate_account
(
u'invalid'
)
activate_account
(
u'invalid'
)
@skip_unless_lms
@skip_unless_lms
@pytest.mark.django111_expected_failure
def
test_request_password_change
(
self
):
def
test_request_password_change
(
self
):
# Create and activate an account
# Create and activate an account
activation_key
=
create_account
(
self
.
USERNAME
,
self
.
PASSWORD
,
self
.
EMAIL
)
activation_key
=
create_account
(
self
.
USERNAME
,
self
.
PASSWORD
,
self
.
EMAIL
)
...
@@ -428,7 +427,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
...
@@ -428,7 +427,6 @@ class AccountCreationActivationAndPasswordChangeTest(TestCase):
self
.
assertIsNot
(
result
,
None
)
self
.
assertIsNot
(
result
,
None
)
@skip_unless_lms
@skip_unless_lms
@pytest.mark.django111_expected_failure
def
test_request_password_change_invalid_user
(
self
):
def
test_request_password_change_invalid_user
(
self
):
with
self
.
assertRaises
(
UserNotFound
):
with
self
.
assertRaises
(
UserNotFound
):
request_password_change
(
self
.
EMAIL
,
self
.
IS_SECURE
)
request_password_change
(
self
.
EMAIL
,
self
.
IS_SECURE
)
...
...
openedx/core/djangoapps/user_api/accounts/tests/test_views.py
View file @
103c723c
...
@@ -640,7 +640,7 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
...
@@ -640,7 +640,7 @@ class TestAccountsAPI(CacheIsolationTestCase, UserAPITestCase):
self
.
assertEqual
(
1
,
len
(
pending_change
))
self
.
assertEqual
(
1
,
len
(
pending_change
))
activation_key
=
pending_change
[
0
]
.
activation_key
activation_key
=
pending_change
[
0
]
.
activation_key
confirm_change_url
=
reverse
(
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
)
response
=
self
.
client
.
post
(
confirm_change_url
)
self
.
assertEqual
(
200
,
response
.
status_code
)
self
.
assertEqual
(
200
,
response
.
status_code
)
...
...
openedx/tests/xblock_integration/test_crowdsource_hinter.py
View file @
103c723c
...
@@ -4,7 +4,6 @@ Test scenarios for the crowdsource hinter xblock.
...
@@ -4,7 +4,6 @@ Test scenarios for the crowdsource hinter xblock.
import
json
import
json
import
unittest
import
unittest
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
...
@@ -136,7 +135,6 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -136,7 +135,6 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestHinterFunctions
(
TestCrowdsourceHinter
):
class
TestHinterFunctions
(
TestCrowdsourceHinter
):
"""
"""
Check that the essential functions of the hinter work as expected.
Check that the essential functions of the hinter work as expected.
...
...
openedx/tests/xblock_integration/test_recommender.py
View file @
103c723c
...
@@ -9,7 +9,6 @@ import StringIO
...
@@ -9,7 +9,6 @@ import StringIO
import
unittest
import
unittest
from
copy
import
deepcopy
from
copy
import
deepcopy
import
pytest
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
...
@@ -197,7 +196,6 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -197,7 +196,6 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestRecommenderCreateFromEmpty
(
TestRecommender
):
class
TestRecommenderCreateFromEmpty
(
TestRecommender
):
"""
"""
Check whether we can add resources to an empty database correctly
Check whether we can add resources to an empty database correctly
...
@@ -258,7 +256,6 @@ class TestRecommenderResourceBase(TestRecommender):
...
@@ -258,7 +256,6 @@ class TestRecommenderResourceBase(TestRecommender):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@pytest.mark.django111_expected_failure
class
TestRecommenderWithResources
(
TestRecommenderResourceBase
):
class
TestRecommenderWithResources
(
TestRecommenderResourceBase
):
"""
"""
Check whether we can add/edit/flag/export resources correctly
Check whether we can add/edit/flag/export resources correctly
...
@@ -425,7 +422,6 @@ class TestRecommenderWithResources(TestRecommenderResourceBase):
...
@@ -425,7 +422,6 @@ class TestRecommenderWithResources(TestRecommenderResourceBase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt
@ddt
@pytest.mark.django111_expected_failure
class
TestRecommenderVoteWithResources
(
TestRecommenderResourceBase
):
class
TestRecommenderVoteWithResources
(
TestRecommenderResourceBase
):
"""
"""
Check whether we can vote resources correctly
Check whether we can vote resources correctly
...
@@ -540,7 +536,6 @@ class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
...
@@ -540,7 +536,6 @@ class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt
@ddt
@pytest.mark.django111_expected_failure
class
TestRecommenderStaffFeedbackWithResources
(
TestRecommenderResourceBase
):
class
TestRecommenderStaffFeedbackWithResources
(
TestRecommenderResourceBase
):
"""
"""
Check whether we can remove/endorse resources correctly
Check whether we can remove/endorse resources correctly
...
@@ -636,7 +631,6 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
...
@@ -636,7 +631,6 @@ class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
@attr
(
shard
=
1
)
@attr
(
shard
=
1
)
@ddt
@ddt
@pytest.mark.django111_expected_failure
class
TestRecommenderFileUploading
(
TestRecommender
):
class
TestRecommenderFileUploading
(
TestRecommender
):
"""
"""
Check whether we can handle file uploading correctly
Check whether we can handle file uploading correctly
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment