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
0bf0d11a
Commit
0bf0d11a
authored
Nov 10, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5906 from stvstnfrd/pep8/newline
Fix newline-related PEP8 issues
parents
6774d1c0
fe1c7d62
Show whitespace changes
Inline
Side-by-side
Showing
156 changed files
with
123 additions
and
80 deletions
+123
-80
cms/djangoapps/contentstore/__init__.py
+0
-1
cms/djangoapps/contentstore/features/common.py
+0
-2
cms/djangoapps/contentstore/management/commands/delete_course.py
+1
-0
cms/djangoapps/contentstore/management/commands/populate_creators.py
+2
-0
cms/djangoapps/contentstore/management/commands/restore_asset_from_trashcan.py
+0
-1
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
+1
-2
cms/djangoapps/contentstore/tests/test_utils.py
+1
-0
cms/djangoapps/contentstore/views/checklist.py
+1
-0
cms/djangoapps/contentstore/views/course.py
+1
-0
cms/djangoapps/contentstore/views/tabs.py
+1
-1
cms/djangoapps/contentstore/views/user.py
+0
-1
cms/djangoapps/models/settings/course_details.py
+1
-0
cms/wsgi.py
+0
-1
common/djangoapps/contentserver/middleware.py
+1
-0
common/djangoapps/course_groups/cohorts.py
+1
-0
common/djangoapps/course_groups/tests/test_views.py
+1
-0
common/djangoapps/course_modes/tests/test_views.py
+0
-1
common/djangoapps/dark_lang/tests.py
+0
-1
common/djangoapps/django_comment_common/tests.py
+1
-0
common/djangoapps/edxmako/makoloader.py
+0
-1
common/djangoapps/edxmako/paths.py
+1
-0
common/djangoapps/edxmako/shortcuts.py
+2
-0
common/djangoapps/edxmako/tests.py
+1
-0
common/djangoapps/embargo/tests/test_middleware.py
+1
-0
common/djangoapps/external_auth/tests/test_ssl.py
+1
-0
common/djangoapps/heartbeat/tests/test_heartbeat.py
+1
-0
common/djangoapps/microsite_configuration/templatetags/microsite.py
+1
-0
common/djangoapps/monitoring/signals.py
+1
-0
common/djangoapps/monitoring/startup.py
+0
-0
common/djangoapps/request_cache/middleware.py
+1
-0
common/djangoapps/status/tests.py
+0
-1
common/djangoapps/student/auth.py
+0
-1
common/djangoapps/student/forms.py
+0
-0
common/djangoapps/student/management/commands/anonymized_id_mapping.py
+0
-1
common/djangoapps/student/middleware.py
+1
-0
common/djangoapps/student/migrations/0041_add_dashboard_config.py
+0
-2
common/djangoapps/student/models.py
+4
-0
common/djangoapps/student/roles.py
+1
-0
common/djangoapps/student/tests/test_auto_auth.py
+1
-0
common/djangoapps/student/tests/test_microsite.py
+3
-0
common/djangoapps/student/tests/test_password_policy.py
+1
-0
common/djangoapps/terrain/stubs/comments.py
+1
-0
common/djangoapps/terrain/stubs/lti.py
+1
-0
common/djangoapps/terrain/stubs/ora.py
+0
-2
common/djangoapps/terrain/stubs/tests/test_lti_stub.py
+1
-0
common/djangoapps/terrain/stubs/video_source.py
+1
-0
common/djangoapps/user_api/tests/factories.py
+1
-0
common/djangoapps/user_api/tests/test_account_api.py
+0
-0
common/djangoapps/util/bad_request_rate_limiter.py
+1
-0
common/djangoapps/util/models.py
+0
-1
common/djangoapps/util/query.py
+0
-0
common/djangoapps/util/string_utils.py
+1
-0
common/djangoapps/util/tests/__init__.py
+0
-1
common/djangoapps/util/tests/test_string_utils.py
+1
-0
common/lib/calc/calc/tests/test_calc.py
+1
-0
common/lib/capa/capa/correctmap.py
+0
-1
common/lib/capa/capa/customrender.py
+0
-1
common/lib/capa/capa/inputtypes.py
+0
-1
common/lib/capa/capa/registry.py
+1
-0
common/lib/capa/capa/safe_exec/lazymod.py
+1
-0
common/lib/capa/capa/tests/test_input_templates.py
+2
-0
common/lib/capa/capa/tests/test_inputtypes.py
+0
-1
common/lib/capa/capa/tests/test_responsetypes.py
+0
-3
common/lib/capa/capa/tests/test_util.py
+0
-1
common/lib/chem/chem/chemcalc.py
+0
-2
common/lib/chem/chem/tests.py
+0
-1
common/lib/django_startup.py
+1
-0
common/lib/symmath/symmath/formula.py
+0
-1
common/lib/symmath/symmath/test_symmath_check.py
+1
-0
common/lib/tempdir.py
+2
-0
common/lib/xmodule/xmodule/annotator_mixin.py
+1
-0
common/lib/xmodule/xmodule/course_module.py
+2
-0
common/lib/xmodule/xmodule/exceptions.py
+0
-1
common/lib/xmodule/xmodule/lti_module.py
+1
-1
common/lib/xmodule/xmodule/mako_module.py
+0
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/__init__.py
+0
-1
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
+2
-0
common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py
+0
-1
common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py
+1
-0
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py
+1
-0
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+0
-1
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+1
-0
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
+1
-0
common/lib/xmodule/xmodule/randomize_module.py
+0
-2
common/lib/xmodule/xmodule/split_test_module.py
+1
-0
common/lib/xmodule/xmodule/tabs.py
+1
-0
common/lib/xmodule/xmodule/template_module.py
+0
-1
common/lib/xmodule/xmodule/tests/rendering/core.py
+1
-0
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
+1
-1
common/lib/xmodule/xmodule/tests/test_capa_module.py
+1
-1
common/lib/xmodule/xmodule/tests/test_content.py
+1
-0
common/lib/xmodule/xmodule/tests/test_editing_module.py
+0
-1
common/lib/xmodule/xmodule/tests/test_import.py
+0
-1
common/lib/xmodule/xmodule/tests/test_utils_django.py
+1
-0
common/lib/xmodule/xmodule/tests/test_word_cloud.py
+0
-1
common/lib/xmodule/xmodule/timeinfo.py
+2
-0
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
+3
-0
common/lib/xmodule/xmodule/x_module.py
+0
-3
common/test/acceptance/fixtures/discussion.py
+1
-0
common/test/acceptance/pages/studio/overview.py
+2
-0
common/test/acceptance/performance/test_studio_performance.py
+1
-0
common/test/acceptance/tests/test_annotatable.py
+0
-1
common/test/data/uploads/python_lib_zip/number_helpers.py
+1
-0
common/xml_cleanup.py
+0
-1
docs/en_us/developers/source/conf.py
+1
-2
docs/en_us/platform_api/source/conf.py
+1
-1
docs/shared/conf.py
+1
-1
lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py
+0
-4
lms/djangoapps/courseware/courses.py
+1
-0
lms/djangoapps/courseware/features/events.py
+1
-0
lms/djangoapps/courseware/features/gst.py
+1
-0
lms/djangoapps/courseware/grades.py
+1
-0
lms/djangoapps/courseware/middleware.py
+1
-0
lms/djangoapps/courseware/module_render.py
+1
-0
lms/djangoapps/courseware/tests/test_access.py
+1
-0
lms/djangoapps/courseware/tests/test_microsites.py
+1
-0
lms/djangoapps/courseware/tests/test_model_data.py
+0
-1
lms/djangoapps/courseware/views.py
+1
-0
lms/djangoapps/dashboard/git_import.py
+1
-0
lms/djangoapps/dashboard/management/commands/git_add_course.py
+1
-0
lms/djangoapps/django_comment_client/forum/tests.py
+1
-0
lms/djangoapps/django_comment_client/tests/group_id.py
+1
-0
lms/djangoapps/django_comment_client/tests/unicode.py
+1
-0
lms/djangoapps/django_comment_client/tests/utils.py
+1
-0
lms/djangoapps/instructor/management/commands/openended_post.py
+1
-0
lms/djangoapps/instructor/offline_gradecalc.py
+1
-0
lms/djangoapps/instructor/views/legacy.py
+1
-0
lms/djangoapps/instructor_task/admin.py
+1
-0
lms/djangoapps/lms_migration/management/commands/create_user.py
+0
-1
lms/djangoapps/lms_migration/migrate.py
+0
-1
lms/djangoapps/notification_prefs/views.py
+1
-1
lms/djangoapps/open_ended_grading/staff_grading_service.py
+1
-0
lms/djangoapps/shoppingcart/exceptions.py
+1
-0
lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py
+0
-2
lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py
+0
-2
lms/djangoapps/shoppingcart/migrations/0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel.py
+0
-2
lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py
+0
-2
lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py
+0
-1
lms/djangoapps/shoppingcart/tests/test_models.py
+1
-0
lms/djangoapps/shoppingcart/views.py
+1
-0
lms/djangoapps/staticbook/views.py
+1
-0
lms/djangoapps/verify_student/models.py
+0
-2
lms/djangoapps/verify_student/tests/test_ssencrypt.py
+2
-0
manage.py
+1
-0
pavelib/acceptance_test.py
+1
-0
pavelib/i18n.py
+1
-0
pavelib/paver_tests/test_paver_get_quality_reports.py
+0
-1
pavelib/paver_tests/test_paver_quality.py
+1
-0
pavelib/quality.py
+4
-0
pavelib/utils/envs.py
+1
-0
pavelib/utils/test/suites/acceptance_suite.py
+0
-1
pavelib/utils/test/utils.py
+1
-1
scripts/all-tests.sh
+1
-1
scripts/run_watch_data.py
+1
-0
scripts/runone.py
+2
-0
No files found.
cms/djangoapps/contentstore/__init__.py
View file @
0bf0d11a
cms/djangoapps/contentstore/features/common.py
View file @
0bf0d11a
...
...
@@ -333,7 +333,6 @@ def get_codemirror_value(index=0, find_prefix="$"):
)
def
attach_file
(
filename
,
sub_path
):
path
=
os
.
path
.
join
(
TEST_ROOT
,
sub_path
,
filename
)
world
.
browser
.
execute_script
(
"$('input.file-input').css('display', 'block')"
)
...
...
@@ -388,4 +387,3 @@ def create_other_user(_step, name, has_extra_perms, role_name):
@step
(
'I log out'
)
def
log_out
(
_step
):
world
.
visit
(
'logout'
)
cms/djangoapps/contentstore/management/commands/delete_course.py
View file @
0bf0d11a
...
...
@@ -9,6 +9,7 @@ from opaque_keys import InvalidKeyError
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
xmodule.modulestore
import
ModuleStoreEnum
class
Command
(
BaseCommand
):
help
=
'''Delete a MongoDB backed course'''
...
...
cms/djangoapps/contentstore/management/commands/populate_creators.py
View file @
0bf0d11a
...
...
@@ -11,6 +11,8 @@ from django.db.utils import IntegrityError
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
#------------ to run: ./manage.py cms populate_creators --settings=dev
class
Command
(
BaseCommand
):
"""
Script for granting existing course instructors course creator privileges.
...
...
cms/djangoapps/contentstore/management/commands/restore_asset_from_trashcan.py
View file @
0bf0d11a
...
...
@@ -10,4 +10,3 @@ class Command(BaseCommand):
raise
CommandError
(
"restore_asset_from_trashcan requires one argument: <location>"
)
restore_asset_from_trashcan
(
args
[
0
])
cms/djangoapps/contentstore/tests/test_transcripts_utils.py
View file @
0bf0d11a
...
...
@@ -161,7 +161,6 @@ class TestDownloadYoutubeSubs(ModuleStoreTestCase):
number
=
'999'
display_name
=
'Test course'
def
clear_sub_content
(
self
,
subs_id
):
"""
Remove, if subtitle content exists.
...
...
@@ -472,6 +471,7 @@ class TestYoutubeTranscripts(unittest.TestCase):
self
.
assertEqual
(
transcripts
,
expected_transcripts
)
mock_get
.
assert_called_with
(
'http://video.google.com/timedtext'
,
params
=
{
'lang'
:
'en'
,
'v'
:
'good_youtube_id'
})
class
TestTranscript
(
unittest
.
TestCase
):
"""
Tests for Transcript class e.g. different transcript conversions.
...
...
@@ -489,7 +489,6 @@ class TestTranscript(unittest.TestCase):
"""
)
self
.
sjson_transcript
=
textwrap
.
dedent
(
"""
\
{
"start": [
...
...
cms/djangoapps/contentstore/tests/test_utils.py
View file @
0bf0d11a
...
...
@@ -86,6 +86,7 @@ class LMSLinksTestCase(TestCase):
link
=
utils
.
get_lms_link_for_item
(
location
)
self
.
assertEquals
(
link
,
"//localhost:8000/courses/mitX/101/test/jump_to/i4x://mitX/101/course/test"
)
class
ExtraPanelTabTestCase
(
TestCase
):
""" Tests adding and removing extra course tabs. """
...
...
cms/djangoapps/contentstore/views/checklist.py
View file @
0bf0d11a
...
...
@@ -124,6 +124,7 @@ def expand_checklist_action_url(course_module, checklist):
return
expanded_checklist
def
localize_checklist_text
(
checklist
):
"""
Localize texts for a given checklist and returns the modified version.
...
...
cms/djangoapps/contentstore/views/course.py
View file @
0bf0d11a
...
...
@@ -261,6 +261,7 @@ def course_rerun_handler(request, course_key_string):
'allow_unicode_course_id'
:
settings
.
FEATURES
.
get
(
'ALLOW_UNICODE_COURSE_ID'
,
False
)
})
def
_course_outline_json
(
request
,
course_module
):
"""
Returns a JSON representation of the course module and recursively all of its children.
...
...
cms/djangoapps/contentstore/views/tabs.py
View file @
0bf0d11a
...
...
@@ -20,6 +20,7 @@ from ..utils import get_lms_link_for_item
__all__
=
[
'tabs_handler'
]
@expect_json
@login_required
@ensure_csrf_cookie
...
...
@@ -203,4 +204,3 @@ def primitive_insert(course, num, tab_type, name):
tabs
=
course
.
tabs
tabs
.
insert
(
num
,
new_tab
)
modulestore
()
.
update_item
(
course
,
ModuleStoreEnum
.
UserID
.
primitive_command
)
cms/djangoapps/contentstore/views/user.py
View file @
0bf0d11a
...
...
@@ -100,7 +100,6 @@ def _course_team_user(request, course_key, email):
}
return
JsonResponse
(
msg
,
400
)
try
:
user
=
User
.
objects
.
get
(
email
=
email
)
except
Exception
:
...
...
cms/djangoapps/models/settings/course_details.py
View file @
0bf0d11a
...
...
@@ -11,6 +11,7 @@ from models.settings import course_grading
from
xmodule.fields
import
Date
from
xmodule.modulestore.django
import
modulestore
class
CourseDetails
(
object
):
def
__init__
(
self
,
org
,
course_id
,
run
):
# still need these for now b/c the client's screen shows these 3 fields
...
...
cms/wsgi.py
View file @
0bf0d11a
...
...
@@ -17,4 +17,3 @@ startup.run()
# as well as any WSGI server configured to use this file.
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
common/djangoapps/contentserver/middleware.py
View file @
0bf0d11a
...
...
@@ -22,6 +22,7 @@ from xmodule.exceptions import NotFoundError
log
=
logging
.
getLogger
(
__name__
)
class
StaticContentServer
(
object
):
def
process_request
(
self
,
request
):
# look to see if the request is prefixed with an asset prefix tag
...
...
common/djangoapps/course_groups/cohorts.py
View file @
0bf0d11a
...
...
@@ -322,6 +322,7 @@ def add_cohort(course_key, name):
)
return
cohort
def
add_user_to_cohort
(
cohort
,
username_or_email
):
"""
Look up the given user, and if successful, add them to the specified cohort.
...
...
common/djangoapps/course_groups/tests/test_views.py
View file @
0bf0d11a
...
...
@@ -209,6 +209,7 @@ class ListCohortsTestCase(CohortViewsTestCase):
actual_cohorts
,
)
class
AddCohortTestCase
(
CohortViewsTestCase
):
"""
Tests the `add_cohort` view.
...
...
common/djangoapps/course_modes/tests/test_views.py
View file @
0bf0d11a
...
...
@@ -150,7 +150,6 @@ class CourseModeViewTest(ModuleStoreTestCase):
response
=
self
.
client
.
get
(
choose_track_url
)
self
.
assertRedirects
(
response
,
reverse
(
'dashboard'
))
# Mapping of course modes to the POST parameters sent
# when the user chooses that mode.
POST_PARAMS_FOR_COURSE_MODE
=
{
...
...
common/djangoapps/dark_lang/tests.py
View file @
0bf0d11a
...
...
@@ -144,7 +144,6 @@ class DarkLangMiddlewareTests(TestCase):
self
.
process_request
(
accept
=
'rel-ter;q=1.0, rel;q=0.5'
)
)
def
assertSessionLangEquals
(
self
,
value
,
request
):
"""
Assert that the 'django_language' set in request.session is equal to value
...
...
common/djangoapps/django_comment_common/tests.py
View file @
0bf0d11a
...
...
@@ -4,6 +4,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
from
django_comment_common.models
import
Role
from
student.models
import
CourseEnrollment
,
User
class
RoleAssignmentTest
(
TestCase
):
"""
Basic checks to make sure our Roles get assigned and unassigned as students
...
...
common/djangoapps/edxmako/makoloader.py
View file @
0bf0d11a
...
...
@@ -34,7 +34,6 @@ class MakoLoader(object):
self
.
module_directory
=
module_directory
def
__call__
(
self
,
template_name
,
template_dirs
=
None
):
return
self
.
load_template
(
template_name
,
template_dirs
)
...
...
common/djangoapps/edxmako/paths.py
View file @
0bf0d11a
...
...
@@ -32,6 +32,7 @@ def clear_lookups(namespace):
if
namespace
in
LOOKUP
:
del
LOOKUP
[
namespace
]
def
add_lookup
(
namespace
,
directory
,
package
=
None
,
prepend
=
False
):
"""
Adds a new mako template lookup directory to the given namespace.
...
...
common/djangoapps/edxmako/shortcuts.py
View file @
0bf0d11a
...
...
@@ -76,6 +76,7 @@ def marketing_link_context_processor(request):
]
)
def
open_source_footer_context_processor
(
request
):
"""
Checks the site name to determine whether to use the edX.org footer or the Open Source Footer.
...
...
@@ -97,6 +98,7 @@ def microsite_footer_context_processor(request):
]
)
def
render_to_string
(
template_name
,
dictionary
,
context
=
None
,
namespace
=
'main'
):
# see if there is an override template defined in the microsite
...
...
common/djangoapps/edxmako/tests.py
View file @
0bf0d11a
...
...
@@ -19,6 +19,7 @@ from edxmako.shortcuts import (
from
student.tests.factories
import
UserFactory
from
util.testing
import
UrlResetMixin
@ddt.ddt
class
ShortcutsTests
(
UrlResetMixin
,
TestCase
):
"""
...
...
common/djangoapps/embargo/tests/test_middleware.py
View file @
0bf0d11a
...
...
@@ -28,6 +28,7 @@ from embargo.models import EmbargoedCourse, EmbargoedState, IPFilter
# that disables the XML modulestore.
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@ddt.ddt
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
...
...
common/djangoapps/external_auth/tests/test_ssl.py
View file @
0bf0d11a
...
...
@@ -37,6 +37,7 @@ FEATURES_WITHOUT_SSL_AUTH['AUTH_USE_CERTIFICATES'] = False
TEST_DATA_MIXED_MODULESTORE
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{})
@override_settings
(
FEATURES
=
FEATURES_WITH_SSL_AUTH
)
class
SSLClientTest
(
ModuleStoreTestCase
):
"""
...
...
common/djangoapps/heartbeat/tests/test_heartbeat.py
View file @
0bf0d11a
...
...
@@ -8,6 +8,7 @@ from django.db.utils import DatabaseError
import
mock
from
django.test.testcases
import
TestCase
class
HeartbeatTestCase
(
TestCase
):
"""
Test the heartbeat
...
...
common/djangoapps/microsite_configuration/templatetags/microsite.py
View file @
0bf0d11a
...
...
@@ -23,6 +23,7 @@ def page_title_breadcrumbs(*crumbs, **kwargs):
else
:
return
platform_name
()
@register.simple_tag
(
name
=
"page_title_breadcrumbs"
,
takes_context
=
True
)
def
page_title_breadcrumbs_tag
(
context
,
*
crumbs
):
"""
...
...
common/djangoapps/monitoring/signals.py
View file @
0bf0d11a
...
...
@@ -78,6 +78,7 @@ def post_save_metrics(sender, **kwargs):
tags
=
_database_tags
(
action
,
sender
,
kwargs
)
dog_stats_api
.
increment
(
'edxapp.db.model'
,
tags
=
tags
)
@receiver
(
post_delete
,
dispatch_uid
=
'edxapp.monitoring.post_delete_metrics'
)
def
post_delete_metrics
(
sender
,
**
kwargs
):
"""
...
...
common/djangoapps/monitoring/startup.py
View file @
0bf0d11a
common/djangoapps/request_cache/middleware.py
View file @
0bf0d11a
...
...
@@ -3,6 +3,7 @@ import threading
_request_cache_threadlocal
=
threading
.
local
()
_request_cache_threadlocal
.
data
=
{}
class
RequestCache
(
object
):
@classmethod
def
get_request_cache
(
cls
):
...
...
common/djangoapps/status/tests.py
View file @
0bf0d11a
...
...
@@ -36,7 +36,6 @@ class TestStatus(TestCase):
"edX/toy/2012_Fall" : "A toy story"
}"""
# json to use, expected results for course=None (e.g. homepage),
# for toy course, for full course. Note that get_site_status_msg
# is supposed to return global message even if course=None. The
...
...
common/djangoapps/student/auth.py
View file @
0bf0d11a
...
...
@@ -83,4 +83,3 @@ def _check_caller_authority(caller, role):
elif
isinstance
(
role
,
CourseRole
):
# instructors can change the roles w/in their course
if
not
has_access
(
caller
,
CourseInstructorRole
(
role
.
course_key
)):
raise
PermissionDenied
common/djangoapps/student/forms.py
View file @
0bf0d11a
common/djangoapps/student/management/commands/anonymized_id_mapping.py
View file @
0bf0d11a
...
...
@@ -65,4 +65,3 @@ class Command(BaseCommand):
))
except
IOError
:
raise
CommandError
(
"Error writing to file:
%
s"
%
output_filename
)
common/djangoapps/student/middleware.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ from django.utils.translation import ugettext as _
from
django.conf
import
settings
from
student.models
import
UserStanding
class
UserStandingMiddleware
(
object
):
"""
Checks a user's standing on request. Returns a 403 if the user's
...
...
common/djangoapps/student/migrations/0041_add_dashboard_config.py
View file @
0bf0d11a
...
...
@@ -18,12 +18,10 @@ class Migration(SchemaMigration):
))
db
.
send_create_signal
(
'student'
,
[
'DashboardConfiguration'
])
def
backwards
(
self
,
orm
):
# Deleting model 'DashboardConfiguration'
db
.
delete_table
(
'student_dashboardconfiguration'
)
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
...
...
common/djangoapps/student/models.py
View file @
0bf0d11a
...
...
@@ -665,15 +665,19 @@ class LoginFailures(models.Model):
class
CourseEnrollmentException
(
Exception
):
pass
class
NonExistentCourseError
(
CourseEnrollmentException
):
pass
class
EnrollmentClosedError
(
CourseEnrollmentException
):
pass
class
CourseFullError
(
CourseEnrollmentException
):
pass
class
AlreadyEnrolledError
(
CourseEnrollmentException
):
pass
...
...
common/djangoapps/student/roles.py
View file @
0bf0d11a
...
...
@@ -210,6 +210,7 @@ class CourseFinanceAdminRole(CourseRole):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
CourseFinanceAdminRole
,
self
)
.
__init__
(
self
.
ROLE
,
*
args
,
**
kwargs
)
class
CourseBetaTesterRole
(
CourseRole
):
"""A course Beta Tester"""
ROLE
=
'beta_testers'
...
...
common/djangoapps/student/tests/test_auto_auth.py
View file @
0bf0d11a
...
...
@@ -11,6 +11,7 @@ from opaque_keys.edx.locator import CourseLocator
from
mock
import
patch
import
ddt
@ddt.ddt
class
AutoAuthEnabledTestCase
(
UrlResetMixin
,
TestCase
):
"""
...
...
common/djangoapps/student/tests/test_microsite.py
View file @
0bf0d11a
...
...
@@ -25,6 +25,7 @@ FAKE_MICROSITE = {
]
}
def
fake_site_name
(
name
,
default
=
None
):
# pylint: disable=W0613
"""
create a fake microsite site name
...
...
@@ -34,12 +35,14 @@ def fake_site_name(name, default=None): # pylint: disable=W0613
else
:
return
default
def
fake_microsite_get_value
(
name
,
default
=
None
):
# pylint: disable=W0613
"""
create a fake microsite site name
"""
return
FAKE_MICROSITE
.
get
(
name
,
default
)
class
TestMicrosite
(
TestCase
):
"""Test for Account Creation from a white labeled Micro-Sites"""
def
setUp
(
self
):
...
...
common/djangoapps/student/tests/test_password_policy.py
View file @
0bf0d11a
...
...
@@ -15,6 +15,7 @@ from edxmako.tests import mako_middleware_process_request
from
external_auth.models
import
ExternalAuthMap
from
student.views
import
create_account
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENFORCE_PASSWORD_POLICY'
:
True
})
class
TestPasswordPolicy
(
TestCase
):
"""
...
...
common/djangoapps/terrain/stubs/comments.py
View file @
0bf0d11a
...
...
@@ -6,6 +6,7 @@ import re
import
urlparse
from
.http
import
StubHttpRequestHandler
,
StubHttpService
class
StubCommentsServiceHandler
(
StubHttpRequestHandler
):
@property
...
...
common/djangoapps/terrain/stubs/lti.py
View file @
0bf0d11a
...
...
@@ -21,6 +21,7 @@ import mock
import
requests
from
http
import
StubHttpRequestHandler
,
StubHttpService
class
StubLtiHandler
(
StubHttpRequestHandler
):
"""
A handler for LTI POST and GET requests.
...
...
common/djangoapps/terrain/stubs/ora.py
View file @
0bf0d11a
...
...
@@ -300,7 +300,6 @@ class StubOraHandler(StubHttpRequestHandler):
"""
self
.
_success_response
({
'problem_list'
:
self
.
server
.
problem_list
})
@require_params
(
'POST'
,
'grader_id'
,
'location'
,
'submission_id'
,
'score'
,
'feedback'
,
'submission_key'
)
def
_save_grade
(
self
):
"""
...
...
@@ -421,7 +420,6 @@ class StubOraHandler(StubHttpRequestHandler):
)
self
.
send_response
(
400
)
def
_student
(
self
,
method
,
key
=
'student_id'
):
"""
Return the `StudentState` instance for the student ID given
...
...
common/djangoapps/terrain/stubs/tests/test_lti_stub.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ import urllib2
import
requests
from
terrain.stubs.lti
import
StubLtiService
class
StubLtiServiceTest
(
unittest
.
TestCase
):
"""
A stub of the LTI provider that listens on a local
...
...
common/djangoapps/terrain/stubs/video_source.py
View file @
0bf0d11a
...
...
@@ -9,6 +9,7 @@ import os
from
logging
import
getLogger
LOGGER
=
getLogger
(
__name__
)
class
VideoSourceRequestHandler
(
SimpleHTTPRequestHandler
):
"""
Request handler for serving video sources locally.
...
...
common/djangoapps/user_api/tests/factories.py
View file @
0bf0d11a
...
...
@@ -5,6 +5,7 @@ from student.tests.factories import UserFactory
from
user_api.models
import
UserPreference
,
UserCourseTag
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232, C0111
class
UserPreferenceFactory
(
DjangoModelFactory
):
...
...
common/djangoapps/user_api/tests/test_account_api.py
View file @
0bf0d11a
common/djangoapps/util/bad_request_rate_limiter.py
View file @
0bf0d11a
...
...
@@ -4,6 +4,7 @@ which can be used for rate limiting
"""
from
ratelimitbackend.backends
import
RateLimitMixin
class
BadRequestRateLimiter
(
RateLimitMixin
):
"""
Use the 3rd party RateLimitMixin to help do rate limiting on the Password Reset flows
...
...
common/djangoapps/util/models.py
View file @
0bf0d11a
# Create your models here.
common/djangoapps/util/query.py
View file @
0bf0d11a
common/djangoapps/util/string_utils.py
View file @
0bf0d11a
...
...
@@ -2,6 +2,7 @@
Utilities for string manipulation.
"""
def
str_to_bool
(
str
):
"""
Converts "true" (case-insensitive) to the boolean True.
...
...
common/djangoapps/util/tests/__init__.py
View file @
0bf0d11a
common/djangoapps/util/tests/test_string_utils.py
View file @
0bf0d11a
...
...
@@ -5,6 +5,7 @@ Tests for string_utils.py
from
django.test
import
TestCase
from
util.string_utils
import
str_to_bool
class
StringUtilsTest
(
TestCase
):
"""
Tests for str_to_bool.
...
...
common/lib/calc/calc/tests/test_calc.py
View file @
0bf0d11a
...
...
@@ -14,6 +14,7 @@ from pyparsing import ParseException
# See http://docs.scipy.org/doc/numpy/reference/generated/numpy.seterr.html
numpy
.
seterr
(
all
=
'ignore'
)
# Also: 'ignore', 'warn' (default), 'raise'
class
EvaluatorTest
(
unittest
.
TestCase
):
"""
Run tests for calc.evaluator
...
...
common/lib/capa/capa/correctmap.py
View file @
0bf0d11a
...
...
@@ -165,7 +165,6 @@ class CorrectMap(object):
self
.
cmap
.
update
(
other_cmap
.
get_dict
())
self
.
set_overall_message
(
other_cmap
.
get_overall_message
())
def
set_overall_message
(
self
,
message_str
):
""" Set a message that applies to the question as a whole,
rather than to individual inputs. """
...
...
common/lib/capa/capa/customrender.py
View file @
0bf0d11a
...
...
@@ -50,7 +50,6 @@ class MathRenderer(object):
mathstr
=
mathstr
.
replace
(
r'\displaystyle'
,
''
)
self
.
mathstr
=
mathstr
.
replace
(
'mathjaxinline]'
,
'
%
s]'
%
mtag
)
def
get_html
(
self
):
"""
Return the contents of this tag, rendered to html, as an etree element.
...
...
common/lib/capa/capa/inputtypes.py
View file @
0bf0d11a
...
...
@@ -839,7 +839,6 @@ class MatlabInput(CodeInput):
'No response from Xqueue within {xqueue_timeout} seconds. Aborted.'
)
.
format
(
xqueue_timeout
=
XQUEUE_TIMEOUT
)
def
handle_ajax
(
self
,
dispatch
,
data
):
"""
Handle AJAX calls directed to this input
...
...
common/lib/capa/capa/registry.py
View file @
0bf0d11a
"""A registry for finding classes based on tags in the class."""
class
TagRegistry
(
object
):
"""
A registry mapping tags to handlers.
...
...
common/lib/capa/capa/safe_exec/lazymod.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ in the public domain.
import
sys
class
LazyModule
(
object
):
"""A lazy module proxy."""
...
...
common/lib/capa/capa/tests/test_input_templates.py
View file @
0bf0d11a
...
...
@@ -11,6 +11,7 @@ from mako.template import Template as MakoTemplate
from
mako
import
exceptions
from
capa.inputtypes
import
Status
class
TemplateError
(
Exception
):
"""
Error occurred while rendering a Mako template.
...
...
@@ -497,6 +498,7 @@ class FormulaEquationInputTemplateTest(TemplateTestCase):
self
.
assert_has_xpath
(
xml
,
"//input[@size='40']"
,
self
.
context
)
class
AnnotationInputTemplateTest
(
TemplateTestCase
):
"""
Test mako template for `<annotationinput>` input.
...
...
common/lib/capa/capa/tests/test_inputtypes.py
View file @
0bf0d11a
...
...
@@ -604,7 +604,6 @@ class MatlabTest(unittest.TestCase):
the_input
=
self
.
input_class
(
test_capa_system
(),
elt
,
state
)
self
.
assertEqual
(
the_input
.
status
,
'queued'
)
@patch
(
'capa.inputtypes.time.time'
,
return_value
=
45
)
def
test_matlab_response_timeout_exceeded
(
self
,
time
):
...
...
common/lib/capa/capa/tests/test_responsetypes.py
View file @
0bf0d11a
...
...
@@ -606,7 +606,6 @@ class StringResponseTest(ResponseTest):
self
.
assert_grade
(
problem
,
u"î"
,
"incorrect"
)
self
.
assert_grade
(
problem
,
u"o"
,
"incorrect"
)
def
test_backslash_and_unicode_regexps
(
self
):
"""
Test some special cases of [unicode] regexps.
...
...
@@ -1042,8 +1041,6 @@ class CodeResponseTest(ResponseTest):
self
.
assertEquals
(
output
[
answer_id
][
'msg'
],
u'Invalid grader reply. Please contact the course staff.'
)
class
ChoiceResponseTest
(
ResponseTest
):
from
capa.tests.response_xml_factory
import
ChoiceResponseXMLFactory
xml_factory_class
=
ChoiceResponseXMLFactory
...
...
common/lib/capa/capa/tests/test_util.py
View file @
0bf0d11a
...
...
@@ -82,7 +82,6 @@ class UtilTest(unittest.TestCase):
result
=
compare_with_tolerance
(
infinity
,
infinity
,
'1.0'
,
False
)
self
.
assertTrue
(
result
)
def
test_sanitize_html
(
self
):
"""
Test for html sanitization with bleach.
...
...
common/lib/chem/chem/chemcalc.py
View file @
0bf0d11a
...
...
@@ -192,7 +192,6 @@ def _render_to_html(tree):
return
children
.
replace
(
' '
,
''
)
def
render_to_html
(
eq
):
'''
Render a chemical equation string to html.
...
...
@@ -231,7 +230,6 @@ def render_to_html(eq):
# only one side
return
spanify
(
render_expression
(
left
))
return
spanify
(
render_expression
(
left
)
+
render_arrow
(
arrow
)
+
render_expression
(
right
))
...
...
common/lib/chem/chem/tests.py
View file @
0bf0d11a
...
...
@@ -64,7 +64,6 @@ class Test_Compare_Equations(unittest.TestCase):
self
.
assertFalse
(
chemical_equations_equal
(
'H2O( -> H2O2'
,
'H2O -> H2O2'
))
self
.
assertFalse
(
chemical_equations_equal
(
'H2 + O2 ==> H2O2'
,
# strange arrow
'2O2 + 2H2 -> 2H2O2'
))
...
...
common/lib/django_startup.py
View file @
0bf0d11a
...
...
@@ -5,6 +5,7 @@ Automatic execution of startup modules in Django apps.
from
importlib
import
import_module
from
django.conf
import
settings
def
autostartup
():
"""
Execute app.startup:run() for all installed django apps
...
...
common/lib/symmath/symmath/formula.py
View file @
0bf0d11a
...
...
@@ -257,7 +257,6 @@ class formula(object):
fix_pmathml
(
xml
)
def
fix_hat
(
xml
):
"""
hat i is turned into <mover><mi>i</mi><mo>^</mo></mover> ; mangle
...
...
common/lib/symmath/symmath/test_symmath_check.py
View file @
0bf0d11a
from
unittest
import
TestCase
from
.symmath_check
import
symmath_check
class
SymmathCheckTest
(
TestCase
):
def
test_symmath_check_integers
(
self
):
number_list
=
[
i
for
i
in
range
(
-
100
,
100
)]
...
...
common/lib/tempdir.py
View file @
0bf0d11a
...
...
@@ -5,12 +5,14 @@ import os.path
import
shutil
import
tempfile
def
mkdtemp_clean
(
suffix
=
""
,
prefix
=
"tmp"
,
dir
=
None
):
"""Just like mkdtemp, but the directory will be deleted when the process ends."""
the_dir
=
tempfile
.
mkdtemp
(
suffix
=
suffix
,
prefix
=
prefix
,
dir
=
dir
)
atexit
.
register
(
cleanup_tempdir
,
the_dir
)
return
the_dir
def
cleanup_tempdir
(
the_dir
):
"""Called on process exit to remove a temp directory."""
if
os
.
path
.
exists
(
the_dir
):
...
...
common/lib/xmodule/xmodule/annotator_mixin.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ from urlparse import urlparse
from
os.path
import
splitext
,
basename
from
HTMLParser
import
HTMLParser
def
get_instructions
(
xmltree
):
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
instructions
=
xmltree
.
find
(
'instructions'
)
...
...
common/lib/xmodule/xmodule/course_module.py
View file @
0bf0d11a
...
...
@@ -28,6 +28,7 @@ CATALOG_VISIBILITY_CATALOG_AND_ABOUT = "both"
CATALOG_VISIBILITY_ABOUT
=
"about"
CATALOG_VISIBILITY_NONE
=
"none"
class
StringOrDate
(
Date
):
def
from_json
(
self
,
value
):
"""
...
...
@@ -589,6 +590,7 @@ class CourseFields(object):
{
"display_name"
:
_
(
"None"
),
"value"
:
CATALOG_VISIBILITY_NONE
}]
)
class
CourseDescriptor
(
CourseFields
,
SequenceDescriptor
):
module_class
=
SequenceModule
...
...
common/lib/xmodule/xmodule/exceptions.py
View file @
0bf0d11a
...
...
@@ -48,7 +48,6 @@ class HeartbeatFailure(Exception):
def
__unicode__
(
self
,
*
args
,
**
kwargs
):
return
self
.
message
def
__init__
(
self
,
msg
,
service
):
"""
In addition to a msg, provide the name of the service.
...
...
common/lib/xmodule/xmodule/lti_module.py
View file @
0bf0d11a
...
...
@@ -752,7 +752,6 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
log
.
debug
(
"[LTI]: Incorrect action."
)
return
Response
(
response_xml_template
.
format
(
**
unsupported_values
),
content_type
=
'application/xml'
)
@classmethod
def
parse_grade_xml_body
(
cls
,
body
):
"""
...
...
@@ -842,6 +841,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'}
return
key
,
secret
return
''
,
''
class
LTIDescriptor
(
LTIFields
,
MetadataOnlyEditingDescriptor
,
EmptyDataRawDescriptor
):
"""
Descriptor for LTI Xmodule.
...
...
common/lib/xmodule/xmodule/mako_module.py
View file @
0bf0d11a
...
...
@@ -39,4 +39,3 @@ class MakoModuleDescriptor(XModuleDescriptor):
def
get_html
(
self
):
return
self
.
system
.
render_template
(
self
.
mako_template
,
self
.
get_context
())
common/lib/xmodule/xmodule/modulestore/split_mongo/__init__.py
View file @
0bf0d11a
...
...
@@ -14,7 +14,6 @@ class BlockKey(namedtuple('BlockKey', 'type id')):
def
__new__
(
cls
,
type
,
id
):
return
super
(
BlockKey
,
cls
)
.
__new__
(
cls
,
type
,
id
)
@classmethod
@contract
(
usage_key
=
BlockUsageLocator
)
def
from_usage_key
(
cls
,
usage_key
):
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split.py
View file @
0bf0d11a
...
...
@@ -1442,6 +1442,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
return
new_course
DEFAULT_ROOT_BLOCK_ID
=
'course'
def
create_course
(
self
,
org
,
course
,
run
,
user_id
,
master_branch
=
None
,
fields
=
None
,
versions_dict
=
None
,
search_targets
=
None
,
root_category
=
'course'
,
...
...
@@ -2689,6 +2690,7 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase):
"""
self
.
db_connection
.
ensure_indexes
()
class
SparseList
(
list
):
"""
Enable inserting items into a list in arbitrary order and then retrieving them.
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/split_mongo_kvs.py
View file @
0bf0d11a
...
...
@@ -38,7 +38,6 @@ class SplitMongoKVS(InheritanceKeyValueStore):
self
.
parent
=
parent
def
get
(
self
,
key
):
# load the field, if needed
if
key
.
field_name
not
in
self
.
_fields
:
...
...
common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py
View file @
0bf0d11a
...
...
@@ -8,6 +8,7 @@ from opaque_keys.edx.keys import UsageKey
# Factories don't have __init__ methods, and are self documenting
# pylint: disable=W0232, C0111
class
SplitFactory
(
factory
.
Factory
):
"""
Abstracted superclass which defines modulestore so that there's no dependency on django
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py
View file @
0bf0d11a
...
...
@@ -12,6 +12,7 @@ from xmodule.modulestore.modulestore_settings import (
get_mixed_stores
,
)
@ddt.ddt
class
ModuleStoreSettingsMigration
(
TestCase
):
"""
...
...
@@ -114,7 +115,6 @@ class ModuleStoreSettingsMigration(TestCase):
}
}
def
assertStoreValuesEqual
(
self
,
store_setting1
,
store_setting2
):
"""
Tests whether the fields in the given store_settings are equal.
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore_bulk_operations.py
View file @
0bf0d11a
...
...
@@ -439,6 +439,7 @@ class TestBulkWriteMixinFindMethods(TestBulkWriteMixin):
def
db_structure
(
_id
):
previous
,
_
,
current
=
_id
.
partition
(
'.'
)
return
{
'db'
:
'structure'
,
'previous_version'
:
previous
,
'_id'
:
current
}
def
active_structure
(
_id
):
previous
,
_
,
current
=
_id
.
partition
(
'.'
)
return
{
'active'
:
'structure'
,
'previous_version'
:
previous
,
'_id'
:
current
}
...
...
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
0bf0d11a
...
...
@@ -188,7 +188,6 @@ def adapt_references(subtree, destination_course_key, export_fs):
)
def
_export_field_content
(
xblock_item
,
item_dir
):
"""
Export all fields related to 'xblock_item' other than 'metadata' and 'data' to json file in provided directory
...
...
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
0bf0d11a
...
...
@@ -390,6 +390,7 @@ def _import_static_content_wrapper(static_content_store, do_import_static, cours
dest_course_id
,
subpath
=
simport
,
verbose
=
verbose
)
def
_import_module_and_update_references
(
module
,
store
,
user_id
,
source_course_id
,
dest_course_id
,
...
...
common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py
View file @
0bf0d11a
...
...
@@ -168,6 +168,7 @@ class MockControllerQueryService(object):
"""
pass
def
convert_seconds_to_human_readable
(
seconds
):
if
seconds
<
60
:
human_string
=
"{0} seconds"
.
format
(
seconds
)
...
...
common/lib/xmodule/xmodule/randomize_module.py
View file @
0bf0d11a
...
...
@@ -77,7 +77,6 @@ class RandomizeModule(RandomizeFields, XModule):
return
[
self
.
child_descriptor
]
def
student_view
(
self
,
context
):
if
self
.
child
is
None
:
# raise error instead? In fact, could complain on descriptor load...
...
...
@@ -95,7 +94,6 @@ class RandomizeDescriptor(RandomizeFields, SequenceDescriptor):
filename_extension
=
"xml"
def
definition_to_xml
(
self
,
resource_fs
):
xml_object
=
etree
.
Element
(
'randomize'
)
...
...
common/lib/xmodule/xmodule/split_test_module.py
View file @
0bf0d11a
...
...
@@ -357,6 +357,7 @@ class SplitTestModule(SplitTestFields, XModule, StudioEditableModule):
"""
return
self
.
descriptor
.
validate
()
@XBlock.needs
(
'user_tags'
)
# pylint: disable=abstract-method
@XBlock.wants
(
'partitions'
)
@XBlock.wants
(
'user'
)
...
...
common/lib/xmodule/xmodule/tabs.py
View file @
0bf0d11a
...
...
@@ -225,6 +225,7 @@ class StaffTab(AuthenticatedCourseTab):
def
can_display
(
self
,
course
,
settings
,
is_user_authenticated
,
is_user_staff
,
is_user_enrolled
):
# pylint: disable=unused-argument
return
is_user_staff
class
EnrolledOrStaffTab
(
CourseTab
):
"""
Abstract class for tabs that can be accessed by only users with staff access
...
...
common/lib/xmodule/xmodule/template_module.py
View file @
0bf0d11a
...
...
@@ -60,7 +60,6 @@ class CustomTagDescriptor(RawDescriptor):
template
=
Template
(
template_module_data
)
return
template
.
render
(
**
params
)
@property
def
rendered_html
(
self
):
return
self
.
render_template
(
self
.
system
,
self
.
data
)
...
...
common/lib/xmodule/xmodule/tests/rendering/core.py
View file @
0bf0d11a
...
...
@@ -40,6 +40,7 @@ import lxml.etree
from
singledispatch
import
singledispatch
@singledispatch
def
assert_student_view_valid_html
(
block
,
html
):
"""
...
...
common/lib/xmodule/xmodule/tests/test_bulk_assertions.py
View file @
0bf0d11a
import
ddt
from
xmodule.tests
import
BulkAssertionTest
@ddt.ddt
class
TestBulkAssertionTestCase
(
BulkAssertionTest
):
...
...
@@ -21,7 +22,6 @@ class TestBulkAssertionTestCase(BulkAssertionTest):
def
test_passing_asserts_passthrough
(
self
,
assertion
,
*
args
):
getattr
(
self
,
assertion
)(
*
args
)
@ddt.data
(
(
'assertTrue'
,
False
),
(
'assertFalse'
,
True
),
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
0bf0d11a
...
...
@@ -142,6 +142,7 @@ class CapaFactory(object):
return
module
class
CapaFactoryWithFiles
(
CapaFactory
):
"""
A factory for creating a Capa problem with files attached.
...
...
@@ -1394,7 +1395,6 @@ class CapaModuleTest(unittest.TestCase):
Run the test for each possible rerandomize value
"""
def
_reset_and_get_seed
(
module
):
"""
Reset the XModule and return the module's seed
...
...
common/lib/xmodule/xmodule/tests/test_content.py
View file @
0bf0d11a
...
...
@@ -44,6 +44,7 @@ Various versions have evolved over the years, sometimes by accident, sometimes o
injected humour and the like).
"""
class
Content
:
def
__init__
(
self
,
location
,
content_type
):
self
.
location
=
location
...
...
common/lib/xmodule/xmodule/tests/test_editing_module.py
View file @
0bf0d11a
...
...
@@ -65,4 +65,3 @@ class TabsEditingDescriptorTestCase(unittest.TestCase):
""""test get_context"""
rendered_context
=
self
.
descriptor
.
get_context
()
self
.
assertListEqual
(
rendered_context
[
'tabs'
],
self
.
tabs
)
common/lib/xmodule/xmodule/tests/test_import.py
View file @
0bf0d11a
...
...
@@ -150,7 +150,6 @@ class ImportTestCase(BaseCourseTestCase):
self
.
assertNotEqual
(
descriptor1
.
location
,
descriptor2
.
location
)
def
test_reimport
(
self
):
'''Make sure an already-exported error xml tag loads properly'''
...
...
common/lib/xmodule/xmodule/tests/test_utils_django.py
View file @
0bf0d11a
...
...
@@ -3,6 +3,7 @@ from xmodule.util.django import get_current_request, get_current_request_hostnam
from
nose.tools
import
assert_is_none
from
unittest
import
TestCase
class
UtilDjangoTests
(
TestCase
):
"""
Tests for methods exposed in util/django
...
...
common/lib/xmodule/xmodule/tests/test_word_cloud.py
View file @
0bf0d11a
...
...
@@ -46,4 +46,3 @@ class WordCloudModuleTest(LogicTest):
self
.
assertEqual
(
100.0
,
sum
(
i
[
'percent'
]
for
i
in
response
[
'top_words'
]))
common/lib/xmodule/xmodule/timeinfo.py
View file @
0bf0d11a
...
...
@@ -2,6 +2,7 @@ import logging
from
xmodule.fields
import
Timedelta
log
=
logging
.
getLogger
(
__name__
)
class
TimeInfo
(
object
):
"""
This is a simple object that calculates and stores datetime information for an XModule
...
...
@@ -14,6 +15,7 @@ class TimeInfo(object):
"""
_delta_standin
=
Timedelta
()
def
__init__
(
self
,
due_date
,
grace_period_string_or_timedelta
):
if
due_date
is
not
None
:
self
.
display_due_date
=
due_date
...
...
common/lib/xmodule/xmodule/video_module/transcripts_utils.py
View file @
0bf0d11a
...
...
@@ -75,6 +75,7 @@ def save_to_store(content, name, mime_type, location):
contentstore
()
.
save
(
content
)
return
content_location
def
save_subs_to_store
(
subs
,
subs_id
,
item
,
language
=
'en'
):
"""
Save transcripts into `StaticContent`.
...
...
@@ -90,6 +91,7 @@ def save_subs_to_store(subs, subs_id, item, language='en'):
filename
=
subs_filename
(
subs_id
,
language
)
return
save_to_store
(
filedata
,
filename
,
'application/json'
,
item
.
location
)
def
get_transcripts_from_youtube
(
youtube_id
,
settings
,
i18n
):
"""
Gets transcripts from youtube for youtube_id.
...
...
@@ -428,6 +430,7 @@ def get_or_create_sjson(item):
sjson_transcript
=
Transcript
.
asset
(
item
.
location
,
source_subs_id
,
item
.
transcript_language
)
.
data
return
sjson_transcript
class
Transcript
(
object
):
"""
Container for transcript methods.
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
0bf0d11a
...
...
@@ -211,7 +211,6 @@ class XModuleMixin(XBlockMixin):
def
runtime
(
self
,
value
):
self
.
_runtime
=
value
@property
def
system
(
self
):
"""
...
...
@@ -719,7 +718,6 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
entry_point
=
"xmodule.v1"
module_class
=
XModule
# VS[compat]. Backwards compatibility code that can go away after
# importing 2012 courses.
# A set of metadata key conversions that we want to make
...
...
@@ -835,7 +833,6 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
"""
pass
# =============================== BUILTIN METHODS ==========================
def
__eq__
(
self
,
other
):
return
(
self
.
scope_ids
==
other
.
scope_ids
and
...
...
common/test/acceptance/fixtures/discussion.py
View file @
0bf0d11a
...
...
@@ -42,6 +42,7 @@ class Thread(ContentFactory):
pinned
=
False
read
=
False
class
Comment
(
ContentFactory
):
thread_id
=
None
depth
=
0
...
...
common/test/acceptance/pages/studio/overview.py
View file @
0bf0d11a
...
...
@@ -307,6 +307,7 @@ class CourseOutlineChild(PageObject, CourseOutlineItem):
grand_locators
=
[
grandkid
.
locator
for
grandkid
in
grandkids
]
return
[
descendant
for
descendant
in
descendants
if
not
descendant
.
locator
in
grand_locators
]
class
CourseOutlineUnit
(
CourseOutlineChild
):
"""
PageObject that wraps a unit link on the Studio Course Outline page.
...
...
@@ -329,6 +330,7 @@ class CourseOutlineUnit(CourseOutlineChild):
return
self
.
q
(
css
=
self
.
_bounded_selector
(
self
.
BODY_SELECTOR
))
.
map
(
lambda
el
:
CourseOutlineUnit
(
self
.
browser
,
el
.
get_attribute
(
'data-locator'
)))
.
results
class
CourseOutlineSubsection
(
CourseOutlineContainer
,
CourseOutlineChild
):
"""
:class`.PageObject` that wraps a subsection block on the Studio Course Outline page.
...
...
common/test/acceptance/performance/test_studio_performance.py
View file @
0bf0d11a
...
...
@@ -6,6 +6,7 @@ from ..pages.studio.auto_auth import AutoAuthPage
from
..pages.studio.overview
import
CourseOutlinePage
from
nose.plugins.attrib
import
attr
@attr
(
har_mode
=
'explicit'
)
class
StudioPagePerformanceTest
(
WebAppTest
):
"""
...
...
common/test/acceptance/tests/test_annotatable.py
View file @
0bf0d11a
...
...
@@ -29,7 +29,6 @@ class AnnotatableProblemTest(UniqueCourseTest):
USERNAME
=
"STAFF_TESTER"
EMAIL
=
"johndoe@example.com"
DATA_TEMPLATE
=
dedent
(
"""
\
<annotatable>
<instructions>Instruction text</instructions>
...
...
common/test/data/uploads/python_lib_zip/number_helpers.py
View file @
0bf0d11a
def
seventeen
():
return
17
def
fortytwo
(
x
):
return
42
+
x
common/xml_cleanup.py
View file @
0bf0d11a
...
...
@@ -86,7 +86,6 @@ def cleanup(filepath, remove_meta):
if
attr
in
attrs
:
del
attrs
[
attr
]
with
open
(
filepath
,
"w"
)
as
f
:
f
.
write
(
etree
.
tostring
(
xml
))
...
...
docs/en_us/developers/source/conf.py
View file @
0bf0d11a
...
...
@@ -10,7 +10,6 @@ from path import path
on_rtd
=
os
.
environ
.
get
(
'READTHEDOCS'
,
None
)
==
'True'
sys
.
path
.
append
(
'../../../../'
)
from
docs.shared.conf
import
*
...
...
@@ -83,6 +82,7 @@ copyright = u'2014, edX'
# Mock all the modules that the readthedocs build can't import
class
Mock
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
...
...
@@ -187,7 +187,6 @@ def strip_tags(html):
return
s
.
get_data
()
def
process_docstring
(
app
,
what
,
name
,
obj
,
options
,
lines
):
"""Autodoc django models"""
...
...
docs/en_us/platform_api/source/conf.py
View file @
0bf0d11a
...
...
@@ -74,6 +74,7 @@ copyright = u'2014, edX'
# Mock all the modules that the readthedocs build can't import
class
Mock
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
pass
...
...
@@ -178,7 +179,6 @@ def strip_tags(html):
return
s
.
get_data
()
def
process_docstring
(
app
,
what
,
name
,
obj
,
options
,
lines
):
"""Autodoc django models"""
...
...
docs/shared/conf.py
View file @
0bf0d11a
...
...
@@ -25,6 +25,7 @@ import sys, os
BASEDIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
def
add_base
(
paths
):
"""
Returns a list of paths relative to BASEDIR.
...
...
@@ -35,7 +36,6 @@ def add_base(paths):
return
[
os
.
path
.
join
(
BASEDIR
,
x
)
for
x
in
paths
]
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
...
...
lms/djangoapps/bulk_email/migrations/0010_auto__chg_field_optout_course_id__add_field_courseemail_template_name_.py
View file @
0bf0d11a
...
...
@@ -21,7 +21,6 @@ class Migration(SchemaMigration):
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
255
,
null
=
True
),
keep_default
=
False
)
# Changing field 'CourseEmail.course_id'
db
.
alter_column
(
'bulk_email_courseemail'
,
'course_id'
,
self
.
gf
(
'xmodule_django.models.CourseKeyField'
)(
max_length
=
255
))
# Adding field 'CourseEmailTemplate.name'
...
...
@@ -29,7 +28,6 @@ class Migration(SchemaMigration):
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
255
,
unique
=
True
,
null
=
True
),
keep_default
=
False
)
# Changing field 'CourseAuthorization.course_id'
db
.
alter_column
(
'bulk_email_courseauthorization'
,
'course_id'
,
self
.
gf
(
'xmodule_django.models.CourseKeyField'
)(
unique
=
True
,
max_length
=
255
))
...
...
@@ -43,13 +41,11 @@ class Migration(SchemaMigration):
# Deleting field 'CourseEmail.from_addr'
db
.
delete_column
(
'bulk_email_courseemail'
,
'from_addr'
)
# Changing field 'CourseEmail.course_id'
db
.
alter_column
(
'bulk_email_courseemail'
,
'course_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
255
))
# Deleting field 'CourseEmailTemplate.name'
db
.
delete_column
(
'bulk_email_courseemailtemplate'
,
'name'
)
# Changing field 'CourseAuthorization.course_id'
db
.
alter_column
(
'bulk_email_courseauthorization'
,
'course_id'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
255
,
unique
=
True
))
...
...
lms/djangoapps/courseware/courses.py
View file @
0bf0d11a
...
...
@@ -259,6 +259,7 @@ def get_course_info_section_module(request, course, section_key):
static_asset_path
=
course
.
static_asset_path
)
def
get_course_info_section
(
request
,
course
,
section_key
):
"""
This returns the snippet of html to be rendered on the course info page,
...
...
lms/djangoapps/courseware/features/events.py
View file @
0bf0d11a
...
...
@@ -41,6 +41,7 @@ def course_url_event_is_emitted(_step, url_regex):
event_type
=
url_regex
.
format
(
world
.
scenario_dict
[
'COURSE'
]
.
id
)
n_events_are_emitted
(
_step
,
1
,
event_type
,
"server"
)
@step
(
r'([aA]n?|\d+) "(.*)" (server|browser) events? is emitted$'
)
def
n_events_are_emitted
(
_step
,
count
,
event_type
,
event_source
):
...
...
lms/djangoapps/courseware/features/gst.py
View file @
0bf0d11a
...
...
@@ -26,6 +26,7 @@ DEFAULT_DATA = """\
</configuration>
"""
@steps
class
GraphicalSliderToolSteps
(
object
):
COURSE_NUM
=
'test_course'
...
...
lms/djangoapps/courseware/grades.py
View file @
0bf0d11a
...
...
@@ -140,6 +140,7 @@ def answer_distributions(course_key):
return
answer_counts
@transaction.commit_manually
def
grade
(
student
,
request
,
course
,
keep_raw_scores
=
False
):
"""
...
...
lms/djangoapps/courseware/middleware.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ from django.core.urlresolvers import reverse
from
courseware.courses
import
UserNotEnrolled
class
RedirectUnenrolledMiddleware
(
object
):
"""
Catch UserNotEnrolled errors thrown by `get_course_with_access` and redirect
...
...
lms/djangoapps/courseware/module_render.py
View file @
0bf0d11a
...
...
@@ -72,6 +72,7 @@ XQUEUE_INTERFACE = XQueueInterface(
# Some brave person should make the variable names consistently someday, but the code's
# coupled enough that it's kind of tricky--you've been warned!
class
LmsModuleRenderError
(
Exception
):
"""
An exception class for exceptions thrown by module_render that don't fit well elsewhere
...
...
lms/djangoapps/courseware/tests/test_access.py
View file @
0bf0d11a
...
...
@@ -18,6 +18,7 @@ from xmodule.course_module import (
# pylint: disable=C0111
# pylint: disable=W0212
class
AccessTestCase
(
TestCase
):
"""
Tests for the various access controls on the student dashboard
...
...
lms/djangoapps/courseware/tests/test_microsites.py
View file @
0bf0d11a
...
...
@@ -14,6 +14,7 @@ from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from
xmodule.course_module
import
(
CATALOG_VISIBILITY_CATALOG_AND_ABOUT
,
CATALOG_VISIBILITY_NONE
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
TestMicrosites
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
...
...
lms/djangoapps/courseware/tests/test_model_data.py
View file @
0bf0d11a
...
...
@@ -238,7 +238,6 @@ class StorageTestBase(object):
self
.
field_data_cache
=
FieldDataCache
([
self
.
mock_descriptor
],
course_id
,
self
.
user
)
self
.
kvs
=
DjangoKeyValueStore
(
self
.
field_data_cache
)
def
test_set_and_get_existing_field
(
self
):
self
.
kvs
.
set
(
self
.
key_factory
(
'existing_field'
),
'test_value'
)
self
.
assertEquals
(
'test_value'
,
self
.
kvs
.
get
(
self
.
key_factory
(
'existing_field'
)))
...
...
lms/djangoapps/courseware/views.py
View file @
0bf0d11a
...
...
@@ -838,6 +838,7 @@ def mktg_course_about(request, course_id):
if
force_english
:
translation
.
deactivate
()
@login_required
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
@transaction.commit_manually
...
...
lms/djangoapps/dashboard/git_import.py
View file @
0bf0d11a
...
...
@@ -51,6 +51,7 @@ class GitImportError(Exception):
CANNOT_BRANCH
=
_
(
'Unable to switch to specified branch. Please check '
'your branch name.'
)
def
cmd_log
(
cmd
,
cwd
):
"""
Helper function to redirect stderr to stdout and log the command
...
...
lms/djangoapps/dashboard/management/commands/git_add_course.py
View file @
0bf0d11a
...
...
@@ -14,6 +14,7 @@ from xmodule.modulestore.xml import XMLModuleStore
log
=
logging
.
getLogger
(
__name__
)
class
Command
(
BaseCommand
):
"""
Pull a git repo and import into the mongo based content database.
...
...
lms/djangoapps/django_comment_client/forum/tests.py
View file @
0bf0d11a
...
...
@@ -569,6 +569,7 @@ class ForumFormDiscussionGroupIdTestCase(CohortedContentTestCase, CohortedTopicG
response
,
lambda
d
:
d
[
'discussion_data'
][
0
]
)
@patch
(
'lms.lib.comment_client.utils.requests.request'
)
class
UserProfileDiscussionGroupIdTestCase
(
CohortedContentTestCase
,
CohortedTopicGroupIdTestMixin
):
cs_endpoint
=
"/active_threads"
...
...
lms/djangoapps/django_comment_client/tests/group_id.py
View file @
0bf0d11a
...
...
@@ -3,6 +3,7 @@ import re
from
course_groups.models
import
CourseUserGroup
class
GroupIdAssertionMixin
(
object
):
def
_data_or_params_cs_request
(
self
,
mock_request
):
"""
...
...
lms/djangoapps/django_comment_client/tests/unicode.py
View file @
0bf0d11a
# coding=utf-8
class
UnicodeTestMixin
(
object
):
def
test_ascii
(
self
):
self
.
_test_unicode_data
(
u"This post contains ASCII."
)
...
...
lms/djangoapps/django_comment_client/tests/utils.py
View file @
0bf0d11a
...
...
@@ -9,6 +9,7 @@ from student.tests.factories import CourseEnrollmentFactory, UserFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
CohortedContentTestCase
(
ModuleStoreTestCase
):
"""
...
...
lms/djangoapps/instructor/management/commands/openended_post.py
View file @
0bf0d11a
...
...
@@ -112,6 +112,7 @@ def post_submission_for_student(student, course, location, task_number, dry_run=
return
False
class
DummyRequest
(
object
):
"""Dummy request"""
...
...
lms/djangoapps/instructor/offline_gradecalc.py
View file @
0bf0d11a
...
...
@@ -16,6 +16,7 @@ from django.contrib.auth.models import User
from
instructor.utils
import
DummyRequest
class
MyEncoder
(
JSONEncoder
):
def
_iterencode
(
self
,
obj
,
markers
=
None
):
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
0bf0d11a
...
...
@@ -1431,6 +1431,7 @@ def get_student_grade_summary_data(request, course, get_grades=True, get_raw_sco
#-----------------------------------------------------------------------------
# enrollment
def
_do_enroll_students
(
course
,
course_key
,
students
,
secure
=
False
,
overload
=
False
,
auto_enroll
=
False
,
email_students
=
False
,
is_shib_course
=
False
):
"""
Do the actual work of enrolling multiple students, presented as a string
...
...
lms/djangoapps/instructor_task/admin.py
View file @
0bf0d11a
...
...
@@ -8,6 +8,7 @@ a task.
from
django.contrib
import
admin
from
.models
import
InstructorTask
class
InstructorTaskAdmin
(
admin
.
ModelAdmin
):
list_display
=
[
'task_id'
,
...
...
lms/djangoapps/lms_migration/management/commands/create_user.py
View file @
0bf0d11a
...
...
@@ -98,7 +98,6 @@ class Command(BaseCommand):
name
=
raw_input
(
'Full name: '
)
user
=
User
(
username
=
uname
,
email
=
email
,
is_active
=
True
)
user
.
set_password
(
password
)
try
:
...
...
lms/djangoapps/lms_migration/migrate.py
View file @
0bf0d11a
...
...
@@ -147,7 +147,6 @@ def manage_modulestores(request, reload_dir=None, commit_id=None):
else
:
html
+=
'<ul><li>
%
s</li></ul>'
%
escape
(
data
)
#----------------------------------------
html
+=
'<hr width="100
%
"/>'
...
...
lms/djangoapps/notification_prefs/views.py
View file @
0bf0d11a
...
...
@@ -132,6 +132,7 @@ def ajax_disable(request):
return
HttpResponse
(
status
=
204
)
@require_GET
def
ajax_status
(
request
):
"""
...
...
@@ -143,7 +144,6 @@ def ajax_status(request):
if
not
request
.
user
.
is_authenticated
():
raise
PermissionDenied
qs
=
UserPreference
.
objects
.
filter
(
user
=
request
.
user
,
key
=
NOTIFICATION_PREF_KEY
...
...
lms/djangoapps/open_ended_grading/staff_grading_service.py
View file @
0bf0d11a
...
...
@@ -278,6 +278,7 @@ def get_next(request, course_id):
return
HttpResponse
(
json
.
dumps
(
_get_next
(
course_key
,
grader_id
,
location
)),
mimetype
=
"application/json"
)
def
get_problem_list
(
request
,
course_id
):
"""
Get all the problems for the given course id
...
...
lms/djangoapps/shoppingcart/exceptions.py
View file @
0bf0d11a
...
...
@@ -4,6 +4,7 @@ Exceptions for the shoppingcart app
# (Exception Class Names are sort of self-explanatory, so skipping docstring requirement)
# pylint: disable=C0111
class
PaymentException
(
Exception
):
pass
...
...
lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py
View file @
0bf0d11a
...
...
@@ -16,12 +16,10 @@ class Migration(SchemaMigration):
))
db
.
send_create_signal
(
'shoppingcart'
,
[
'Donation'
])
def
backwards
(
self
,
orm
):
# Deleting model 'Donation'
db
.
delete_table
(
'shoppingcart_donation'
)
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
...
...
lms/djangoapps/shoppingcart/migrations/0019_auto__add_donationconfiguration.py
View file @
0bf0d11a
...
...
@@ -17,12 +17,10 @@ class Migration(SchemaMigration):
))
db
.
send_create_signal
(
'shoppingcart'
,
[
'DonationConfiguration'
])
def
backwards
(
self
,
orm
):
# Deleting model 'DonationConfiguration'
db
.
delete_table
(
'shoppingcart_donationconfiguration'
)
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
...
...
lms/djangoapps/shoppingcart/migrations/0020_auto__add_courseregcodeitem__add_courseregcodeitemannotation__add_fiel.py
View file @
0bf0d11a
...
...
@@ -59,7 +59,6 @@ class Migration(SchemaMigration):
self
.
gf
(
'django.db.models.fields.CharField'
)(
default
=
'personal'
,
max_length
=
32
),
keep_default
=
False
)
def
backwards
(
self
,
orm
):
# Deleting model 'CourseRegCodeItem'
db
.
delete_table
(
'shoppingcart_courseregcodeitem'
)
...
...
@@ -88,7 +87,6 @@ class Migration(SchemaMigration):
# Deleting field 'Order.order_type'
db
.
delete_column
(
'shoppingcart_order'
,
'order_type'
)
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
...
...
lms/djangoapps/shoppingcart/migrations/0021_auto__add_field_orderitem_created__add_field_orderitem_modified.py
View file @
0bf0d11a
...
...
@@ -18,7 +18,6 @@ class Migration(SchemaMigration):
self
.
gf
(
'model_utils.fields.AutoLastModifiedField'
)(
default
=
datetime
.
datetime
.
now
),
keep_default
=
False
)
def
backwards
(
self
,
orm
):
# Deleting field 'OrderItem.created'
db
.
delete_column
(
'shoppingcart_orderitem'
,
'created'
)
...
...
@@ -26,7 +25,6 @@ class Migration(SchemaMigration):
# Deleting field 'OrderItem.modified'
db
.
delete_column
(
'shoppingcart_orderitem'
,
'modified'
)
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
...
...
lms/djangoapps/shoppingcart/processors/tests/test_CyberSource.py
View file @
0bf0d11a
...
...
@@ -263,7 +263,6 @@ class CyberSourceTests(TestCase):
# finally, tests an accepted order
self
.
assertTrue
(
payment_accepted
(
params
)[
'accepted'
])
@patch
(
'shoppingcart.processors.CyberSource.render_to_string'
,
autospec
=
True
)
def
test_render_purchase_form_html
(
self
,
render
):
"""
...
...
lms/djangoapps/shoppingcart/tests/test_models.py
View file @
0bf0d11a
...
...
@@ -37,6 +37,7 @@ from opaque_keys.edx.locator import CourseLocator
# that disables the XML modulestore.
MODULESTORE_CONFIG
=
mixed_store_config
(
settings
.
COMMON_TEST_DATA_ROOT
,
{},
include_xml
=
False
)
@override_settings
(
MODULESTORE
=
MODULESTORE_CONFIG
)
class
OrderTest
(
ModuleStoreTestCase
):
def
setUp
(
self
):
...
...
lms/djangoapps/shoppingcart/views.py
View file @
0bf0d11a
...
...
@@ -196,6 +196,7 @@ def remove_item(request):
return
HttpResponse
(
'OK'
)
def
remove_code_redemption
(
order_item_course_id
,
item_id
,
item
,
user
):
"""
If an item removed from shopping cart then we will remove
...
...
lms/djangoapps/staticbook/views.py
View file @
0bf0d11a
...
...
@@ -130,6 +130,7 @@ def pdf_index(request, course_id, book_index, chapter=None, page=None):
},
)
@login_required
def
html_index
(
request
,
course_id
,
book_index
,
chapter
=
None
):
"""
...
...
lms/djangoapps/verify_student/models.py
View file @
0bf0d11a
...
...
@@ -310,7 +310,6 @@ class PhotoVerification(StatusModel):
return
(
status
,
error_msg
)
def
parsed_error_msg
(
self
):
"""
Sometimes, the error message we've received needs to be parsed into
...
...
@@ -777,7 +776,6 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
return
header_txt
+
"
\n\n
"
+
body_txt
def
send_request
(
self
):
"""
Assembles a submission to Software Secure and sends it via HTTPS.
...
...
lms/djangoapps/verify_student/tests/test_ssencrypt.py
View file @
0bf0d11a
...
...
@@ -7,6 +7,7 @@ from verify_student.ssencrypt import (
rsa_decrypt
,
rsa_encrypt
,
random_aes_key
)
def
test_aes
():
key_str
=
"32fe72aaf2abb44de9e161131b5435c8d37cbdb6f5df242ae860b283115f2dae"
key
=
key_str
.
decode
(
"hex"
)
...
...
@@ -28,6 +29,7 @@ def test_aes():
assert_roundtrip
(
""
)
assert_roundtrip
(
"
\xe9\xe1
a
\x13\x1b
T5
\xc8
"
)
# Random, non-ASCII text
def
test_rsa
():
# Make up some garbage keys for testing purposes.
pub_key_str
=
"""-----BEGIN PUBLIC KEY-----
...
...
manage.py
View file @
0bf0d11a
...
...
@@ -21,6 +21,7 @@ import importlib
from
argparse
import
ArgumentParser
import
contracts
def
parse_args
():
"""Parse edx specific arguments to manage.py"""
parser
=
ArgumentParser
()
...
...
pavelib/acceptance_test.py
View file @
0bf0d11a
...
...
@@ -12,6 +12,7 @@ except ImportError:
__test__
=
False
# do not collect
@task
@needs
(
'pavelib.prereqs.install_prereqs'
,
...
...
pavelib/i18n.py
View file @
0bf0d11a
...
...
@@ -168,6 +168,7 @@ def i18n_ltr():
sh
(
'git add conf/locale'
)
sh
(
'git commit --amend'
)
@task
@needs
(
"pavelib.i18n.i18n_transifex_pull"
,
...
...
pavelib/paver_tests/test_paver_get_quality_reports.py
View file @
0bf0d11a
...
...
@@ -9,7 +9,6 @@ import paver.easy
from
paver.easy
import
BuildFailure
class
TestGetReportFiles
(
unittest
.
TestCase
):
"""
Ensure only the report files we want are returned as part of run_quality.
...
...
pavelib/paver_tests/test_paver_quality.py
View file @
0bf0d11a
...
...
@@ -8,6 +8,7 @@ import pavelib.quality
import
paver.easy
from
paver.easy
import
BuildFailure
@ddt
class
TestPaverQualityViolations
(
unittest
.
TestCase
):
...
...
pavelib/quality.py
View file @
0bf0d11a
...
...
@@ -65,6 +65,7 @@ def run_pylint(options):
raise
Exception
(
"Failed. Too many pylint violations. "
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
def
_count_pylint_violations
(
report_file
):
"""
Parses a pylint report line-by-line and determines the number of violations reported
...
...
@@ -83,6 +84,7 @@ def _count_pylint_violations(report_file):
num_violations_report
+=
1
return
num_violations_report
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
...
...
@@ -113,10 +115,12 @@ def run_pep8(options):
raise
Exception
(
"Failed. Too many pep8 violations. "
"The limit is {violations_limit}."
.
format
(
violations_limit
=
violations_limit
))
def
_count_pep8_violations
(
report_file
):
num_lines
=
sum
(
1
for
line
in
open
(
report_file
))
return
num_lines
@task
@needs
(
'pavelib.prereqs.install_python_prereqs'
)
@cmdopts
([
...
...
pavelib/utils/envs.py
View file @
0bf0d11a
...
...
@@ -9,6 +9,7 @@ from lazy import lazy
from
path
import
path
import
memcache
class
Env
(
object
):
"""
Load information about the execution environment.
...
...
pavelib/utils/test/suites/acceptance_suite.py
View file @
0bf0d11a
...
...
@@ -95,7 +95,6 @@ class AcceptanceTestSuite(TestSuite):
if
not
self
.
fasttest
:
self
.
_setup_acceptance_db
()
def
_setup_acceptance_db
(
self
):
"""
TODO: Improve the following
...
...
pavelib/utils/test/utils.py
View file @
0bf0d11a
...
...
@@ -54,6 +54,7 @@ def clean_mongo():
repo_root
=
Env
.
REPO_ROOT
,
))
def
check_firefox_version
():
"""
Check that firefox is the correct version.
...
...
@@ -72,4 +73,3 @@ def check_firefox_version():
'
\t
$ firefox --version
\n
'
'
\t
{version}'
.
format
(
version
=
expected_firefox_ver
)
)
scripts/all-tests.sh
View file @
0bf0d11a
...
...
@@ -57,7 +57,7 @@ set -e
# Violations thresholds for failing the build
PYLINT_THRESHOLD
=
4725
PEP8_THRESHOLD
=
4
00
PEP8_THRESHOLD
=
2
00
source
$HOME
/jenkins_env
...
...
scripts/run_watch_data.py
View file @
0bf0d11a
...
...
@@ -22,6 +22,7 @@ EXTENSIONS = ["*", "xml", "js", "css", "coffee", "scss", "html"]
WATCH_DIRS
=
[
os
.
path
.
abspath
(
os
.
path
.
normpath
(
dir
))
for
dir
in
WATCH_DIRS
]
class
DjangoEventHandler
(
FileSystemEventHandler
):
def
__init__
(
self
,
process
):
...
...
scripts/runone.py
View file @
0bf0d11a
...
...
@@ -9,6 +9,7 @@ import sys
# to become:
# test --settings=cms.envs.test --pythonpath=. -s cms/djangoapps/contentstore/tests/test_course_settings.py:CourseDetailsViewTest.test_update_and_fetch
def
find_full_path
(
path_to_file
):
"""Find the full path where we only have a relative path from somewhere in the tree."""
for
subdir
,
dirs
,
files
in
os
.
walk
(
"."
):
...
...
@@ -16,6 +17,7 @@ def find_full_path(path_to_file):
if
os
.
path
.
exists
(
full
):
return
full
def
main
(
argv
):
parser
=
argparse
.
ArgumentParser
(
description
=
"Run just one test"
)
parser
.
add_argument
(
'--nocapture'
,
'-s'
,
action
=
'store_true'
,
help
=
"Don't capture stdout (any stdout output will be printed immediately)"
)
...
...
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