Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# Pattern to match a library key only
LIBRARY_KEY_PATTERN = r'(?P<library_key_string>library-v1:[^/+]+\+[^/+]+)'

urlpatterns = patterns('', # nopep8
urlpatterns = patterns(
'',

url(r'^transcripts/upload$', 'contentstore.views.upload_transcripts', name='upload_transcripts'),
url(r'^transcripts/download$', 'contentstore.views.download_transcripts', name='download_transcripts'),
Expand Down
4 changes: 3 additions & 1 deletion common/djangoapps/heartbeat/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from django.conf.urls import url, patterns

urlpatterns = patterns('', # nopep8
urlpatterns = patterns(
'',

url(r'^$', 'heartbeat.views.heartbeat', name='heartbeat'),
)
4 changes: 3 additions & 1 deletion common/djangoapps/pipeline_js/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"""
from django.conf.urls import url, patterns

urlpatterns = patterns('pipeline_js.views', # nopep8
urlpatterns = patterns(
'pipeline_js.views',

url(r'^files\.json$', 'xmodule_js_files', name='xmodule_js_files'),
url(r'^xmodule\.js$', 'requirejs_xmodule', name='requirejs_xmodule'),
)
4 changes: 0 additions & 4 deletions docs/en_us/enrollment_api/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
else:
os.environ['DJANGO_SETTINGS_MODULE'] = 'lms'



# -- General configuration -----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be extensions
Expand All @@ -72,5 +70,3 @@

project = u'edX Enrollment API Version 1'
copyright = u'2015, edX'


46 changes: 35 additions & 11 deletions docs/en_us/platform_api/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,41 @@
from path import path
import sys
import mock

MOCK_MODULES = ['lxml', 'requests', 'xblock', 'fields', 'xblock.fields',
'frament', 'xblock.fragment', 'webob', 'multidict', 'webob.multidict', 'core',
'xblock.core', 'runtime', 'xblock.runtime', 'sortedcontainers', 'contracts',
'plugin', 'xblock.plugin', 'opaque_keys.edx.asides', 'asides',
'dogstats_wrapper', 'fs', 'fs.errors', 'edxmako', 'edxmako.shortcuts',
'shortcuts', 'crum', 'opaque_keys.edx.locator', 'LibraryLocator', 'Location']

for mod_name in MOCK_MODULES:

MOCK_MODULES = [
'lxml',
'requests',
'xblock',
'fields',
'xblock.fields',
'frament',
'xblock.fragment',
'webob',
'multidict',
'webob.multidict',
'core',
'xblock.core',
'runtime',
'xblock.runtime',
'sortedcontainers',
'contracts',
'plugin',
'xblock.plugin',
'opaque_keys.edx.asides',
'asides',
'dogstats_wrapper',
'fs',
'fs.errors',
'edxmako',
'edxmako.shortcuts',
'shortcuts',
'crum',
'opaque_keys.edx.locator',
'LibraryLocator',
'Location',
]

for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand Down Expand Up @@ -83,5 +109,3 @@
copyright = u'2015, edX'

exclude_patterns = ['build', 'links.rst']


4 changes: 3 additions & 1 deletion lms/djangoapps/class_dashboard/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from django.conf import settings
COURSE_ID_PATTERN = settings.COURSE_ID_PATTERN

urlpatterns = patterns('', # nopep8
urlpatterns = patterns(
'',

# Json request data for metrics for entire course
url(r'^{}/all_sequential_open_distrib$'.format(settings.COURSE_ID_PATTERN),
'class_dashboard.views.all_sequential_open_distrib', name="all_sequential_open_distrib"),
Expand Down
4 changes: 3 additions & 1 deletion lms/djangoapps/django_comment_client/base/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.conf.urls.defaults import url, patterns

urlpatterns = patterns('django_comment_client.base.views', # nopep8
urlpatterns = patterns(
'django_comment_client.base.views',

url(r'upload$', 'upload', name='upload'),
url(r'threads/(?P<thread_id>[\w\-]+)/update$', 'update_thread', name='update_thread'),
url(r'threads/(?P<thread_id>[\w\-]+)/reply$', 'create_comment', name='create_comment'),
Expand Down
4 changes: 3 additions & 1 deletion lms/djangoapps/django_comment_client/forum/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.conf.urls.defaults import url, patterns

urlpatterns = patterns('django_comment_client.forum.views', # nopep8
urlpatterns = patterns(
'django_comment_client.forum.views',

url(r'users/(?P<user_id>\w+)/followed$', 'followed_threads', name='followed_threads'),
url(r'users/(?P<user_id>\w+)$', 'user_profile', name='user_profile'),
url(r'^(?P<discussion_id>[\w\-.]+)/threads/(?P<thread_id>\w+)$', 'single_thread', name='single_thread'),
Expand Down
4 changes: 3 additions & 1 deletion lms/djangoapps/django_comment_client/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.conf.urls.defaults import url, patterns, include

urlpatterns = patterns('', # nopep8
urlpatterns = patterns(
'',

url(r'forum/?', include('django_comment_client.forum.urls')),
url(r'', include('django_comment_client.base.urls')),
)
4 changes: 3 additions & 1 deletion lms/djangoapps/instructor/views/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

from django.conf.urls import patterns, url

urlpatterns = patterns('', # nopep8
urlpatterns = patterns(
'',

url(r'^students_update_enrollment$',
'instructor.views.api.students_update_enrollment', name="students_update_enrollment"),
url(r'^register_and_enroll_students$',
Expand Down
4 changes: 3 additions & 1 deletion lms/djangoapps/shoppingcart/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from django.conf.urls import patterns, url
from django.conf import settings

urlpatterns = patterns('shoppingcart.views', # nopep8
urlpatterns = patterns(
'shoppingcart.views',

url(r'^postpay_callback/$', 'postpay_callback'), # Both the ~accept and ~reject callback pages are handled here
url(r'^receipt/(?P<ordernum>[0-9]*)/$', 'show_receipt'),
url(r'^donation/$', 'donate', name='donation'),
Expand Down
4 changes: 3 additions & 1 deletion lms/djangoapps/survey/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
from django.conf.urls import patterns, url


urlpatterns = patterns('survey.views', # nopep8
urlpatterns = patterns(
'survey.views',

url(r'^(?P<survey_name>[0-9A-Za-z]+)/$', 'view_survey', name='view_survey'),
url(r'^(?P<survey_name>[0-9A-Za-z]+)/answers/$', 'submit_answers', name='submit_answers'),
)
4 changes: 3 additions & 1 deletion lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

# Use urlpatterns formatted as within the Django docs with first parameter "stuck" to the open parenthesis
# pylint: disable=bad-continuation
urlpatterns = ('', # nopep8
urlpatterns = (
'',

# certificate view
url(r'^update_certificate$', 'certificates.views.update_certificate'),
url(r'^request_certificate$', 'certificates.views.request_certificate'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def test_get_cohort_with_assign(self):
# get_cohort should return a group for user
self.assertEquals(cohorts.get_cohort(user, course.id).name, "AutoGroup")


def test_auto_cohorting(self):
"""
Make sure cohorts.get_cohort() does the right thing with auto_cohort_groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@

TEST_PASSWORD = "test"


@ddt.ddt
@unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms')
class TestAccountAPI(APITestCase):

def setUp(self):
super(TestAccountAPI, self).setUp()

self.anonymous_client = APIClient()

self.different_user = UserFactory.create(password=TEST_PASSWORD)
self.different_client = APIClient()

self.staff_user = UserFactory(is_staff=True, password=TEST_PASSWORD)
self.staff_client = APIClient()

self.user = UserFactory.create(password=TEST_PASSWORD)

self.url = reverse("accounts_api", kwargs={'username': self.user.username})

def test_get_account_anonymous_user(self):
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_api/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ def _get_validation_errors(self, update, serializer):
}

validation_errors['field_errors'] = field_errors
return validation_errors
return validation_errors
1 change: 0 additions & 1 deletion openedx/core/djangoapps/user_api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1599,4 +1599,3 @@ def test_update_email_opt_with_invalid_course_key(self):
self.assertHttpBadRequest(response)
with self.assertRaises(UserOrgTag.DoesNotExist):
UserOrgTag.objects.get(user=self.user, org=self.course.id.org, key="email-optin")

1 change: 1 addition & 0 deletions openedx/core/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def dump_memory(signum, frame):
"""Dump memory stats for the current process to a temp directory. Uses the meliae output format."""
scanner.dump_all_objects('{}/meliae.{}.{}.dump'.format(tempfile.gettempdir(), datetime.now().isoformat(), os.getpid()))


def install_memory_dumper(dump_signal=signal.SIGPROF):
"""
Install a signal handler on `signal` to dump memory stats for the current process.
Expand Down
3 changes: 2 additions & 1 deletion pavelib/bok_choy.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ def run_bokchoy(**opts):
msg = colorize(
'green',
'Running tests using {default_store} modulestore.'.format(
default_store=test_suite.default_store)
default_store=test_suite.default_store,
)
)
print(msg)
test_suite.run()

Expand Down
23 changes: 14 additions & 9 deletions pavelib/paver_tests/test_paver_bok_choy_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ def setUp(self):
def _expected_command(self, expected_text_append, expected_default_store=None):
if expected_text_append:
expected_text_append = "/" + expected_text_append
expected_statement = ("DEFAULT_STORE={default_store} SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 ".format(default_store=expected_default_store,
repo_dir=REPO_DIR,
exp_text=expected_text_append))
expected_statement = (
"DEFAULT_STORE={default_store} "
"SCREENSHOT_DIR='{repo_dir}/test_root/log' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log/hars' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log' "
"nosetests {repo_dir}/common/test/acceptance/tests{exp_text} "
"--with-xunit "
"--xunit-file={repo_dir}/reports/bok_choy/xunit.xml "
"--verbosity=2 "
).format(
default_store=expected_default_store,
repo_dir=REPO_DIR,
exp_text=expected_text_append,
)
return expected_statement

def test_default_bokchoy(self):
Expand Down
8 changes: 5 additions & 3 deletions pavelib/paver_tests/test_paver_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ def test_pylint_parser_pep8(self):

@file_data('pylint_test_list.json')
def test_pylint_parser_count_violations(self, value):
# Tests:
# * Different types of violations
# * One violation covering multiple lines
"""
Tests:
- Different types of violations
- One violation covering multiple lines
"""
with open(self.f.name, 'w') as f:
f.write(value)
num = pavelib.quality._count_pylint_violations(f.name)
Expand Down
Loading