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
8a6699a4
Commit
8a6699a4
authored
Jan 14, 2016
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Studio breaks DEFAULT_COURSE_ABOUT_IMAGE_URL is not set in settings in cms
ECOM-3384
parent
039e6cdf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
29 deletions
+45
-29
cms/envs/aws.py
+3
-0
cms/envs/common.py
+1
-0
lms/djangoapps/instructor/tests/test_api.py
+26
-0
openedx/core/lib/api/tests/test_paginators.py
+1
-2
openedx/core/lib/block_cache/tests/test_block_cache.py
+3
-1
openedx/core/lib/tests/test_courses.py
+10
-4
openedx/core/lib/tests/test_xblock_utils.py
+0
-22
pavelib/utils/test/suites/nose_suite.py
+1
-0
No files found.
cms/envs/aws.py
View file @
8a6699a4
...
...
@@ -101,6 +101,9 @@ if STATIC_URL_BASE:
STATIC_URL
+=
"/"
STATIC_URL
+=
EDX_PLATFORM_REVISION
+
"/"
# DEFAULT_COURSE_ABOUT_IMAGE_URL specifies the default image to show for courses that don't provide one
DEFAULT_COURSE_ABOUT_IMAGE_URL
=
ENV_TOKENS
.
get
(
'DEFAULT_COURSE_ABOUT_IMAGE_URL'
,
DEFAULT_COURSE_ABOUT_IMAGE_URL
)
# GITHUB_REPO_ROOT is the base directory
# for course data
GITHUB_REPO_ROOT
=
ENV_TOKENS
.
get
(
'GITHUB_REPO_ROOT'
,
GITHUB_REPO_ROOT
)
...
...
cms/envs/common.py
View file @
8a6699a4
...
...
@@ -56,6 +56,7 @@ from lms.envs.common import (
# The following setting is included as it is used to check whether to
# display credit eligibility table on the CMS or not.
ENABLE_CREDIT_ELIGIBILITY
,
YOUTUBE_API_KEY
,
DEFAULT_COURSE_ABOUT_IMAGE_URL
,
# Django REST framework configuration
REST_FRAMEWORK
,
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
8a6699a4
...
...
@@ -29,6 +29,7 @@ from nose.tools import raises
from
nose.plugins.attrib
import
attr
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locator
import
UsageKey
from
xmodule.modulestore
import
ModuleStoreEnum
from
course_modes.models
import
CourseMode
from
courseware.models
import
StudentModule
...
...
@@ -66,6 +67,7 @@ from certificates.tests.factories import GeneratedCertificateFactory
from
certificates.models
import
CertificateStatuses
from
openedx.core.djangoapps.course_groups.cohorts
import
set_course_cohort_settings
from
openedx.core.lib.xblock_utils
import
grade_histogram
from
.test_tools
import
msk_from_problem_urlname
...
...
@@ -3092,6 +3094,7 @@ class TestInstructorAPIRegradeTask(SharedModuleStoreTestCase, LoginEnrollmentTes
@attr
(
'shard_1'
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENTRANCE_EXAMS'
:
True
})
@ddt.ddt
class
TestEntranceExamInstructorAPIRegradeTask
(
SharedModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
Test endpoints whereby instructors can rescore student grades,
...
...
@@ -3160,6 +3163,29 @@ class TestEntranceExamInstructorAPIRegradeTask(SharedModuleStoreTestCase, LoginE
)
self
.
ee_modules
=
[
ee_module_to_reset1
.
module_state_key
,
ee_module_to_reset2
.
module_state_key
]
@ddt.data
(
ModuleStoreEnum
.
Type
.
split
,
ModuleStoreEnum
.
Type
.
mongo
)
def
test_grade_histogram
(
self
,
store
):
"""
Verify that a histogram has been created.
"""
course
=
CourseFactory
.
create
(
default_store
=
store
)
usage_key
=
course
.
id
.
make_usage_key
(
'problem'
,
'first_problem'
)
StudentModule
.
objects
.
create
(
student_id
=
1
,
grade
=
100
,
module_state_key
=
usage_key
)
StudentModule
.
objects
.
create
(
student_id
=
2
,
grade
=
50
,
module_state_key
=
usage_key
)
grades
=
grade_histogram
(
usage_key
)
self
.
assertEqual
(
grades
[
0
],
(
50.0
,
1
))
self
.
assertEqual
(
grades
[
1
],
(
100.0
,
1
))
def
test_reset_entrance_exam_student_attempts_deletall
(
self
):
""" Make sure no one can delete all students state on entrance exam. """
url
=
reverse
(
'reset_student_attempts_for_entrance_exam'
,
...
...
openedx/core/lib/api/tests/test_paginators.py
View file @
8a6699a4
...
...
@@ -107,8 +107,7 @@ class PaginateSearchResultsTestCase(TestCase):
id_range
=
get_object_range
(
page_number
,
page_size
)
db_objects
=
[
build_mock_object
(
obj_id
)
for
obj_id
in
id_range
]
self
.
mock_model
.
objects
.
filter
=
MagicMock
(
return_value
=
db_objects
)
page
=
paginate_search_results
(
self
.
mock_model
,
self
.
search_results
,
self
.
default_size
,
'last'
)
page
=
paginate_search_results
(
self
.
mock_model
,
self
.
search_results
,
page_size
,
'last'
)
self
.
mock_model
.
objects
.
filter
.
assert_called_with
(
pk__in
=
id_range
)
self
.
assertEquals
(
db_objects
,
page
.
object_list
)
...
...
openedx/core/lib/block_cache/tests/test_block_cache.py
View file @
8a6699a4
...
...
@@ -3,8 +3,9 @@ Tests for block_cache.py
"""
from
django.core.cache
import
get_cache
from
django.conf
import
settings
from
mock
import
patch
from
unittest
import
TestCase
from
unittest
import
TestCase
,
skipUnless
from
..block_cache
import
get_blocks
from
..exceptions
import
TransformerException
...
...
@@ -96,6 +97,7 @@ class TestBlockCache(TestCase, ChildrenMapTestMixin):
transformers
=
self
.
transformers
,
)
@skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
def
test_block_caching
(
self
,
mock_available_transforms
):
mock_available_transforms
.
return_value
=
{
transformer
.
name
():
transformer
for
transformer
in
self
.
transformers
}
...
...
openedx/core/lib/tests/test_courses.py
View file @
8a6699a4
...
...
@@ -3,6 +3,8 @@ Tests for functionality in openedx/core/lib/courses.py.
"""
import
ddt
from
django.test.utils
import
override_settings
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
...
...
@@ -48,12 +50,16 @@ class CourseImageTestCase(ModuleStoreTestCase):
course_image_url
(
course
)
)
@override_settings
(
DEFAULT_COURSE_ABOUT_IMAGE_URL
=
'test.png'
)
@override_settings
(
STATIC_URL
=
'static/'
)
@ddt.data
(
ModuleStoreEnum
.
Type
.
split
,
ModuleStoreEnum
.
Type
.
mongo
)
def
test_empty_image_name
(
self
,
default_store
):
""" Verify that empty image names are cleaned """
course_image
=
u''
course
=
CourseFactory
.
create
(
course_image
=
course_image
,
default_store
=
default_store
)
"""
Verify that if a course has empty `course_image`, `course_image_url` returns
`DEFAULT_COURSE_ABOUT_IMAGE_URL` defined in the settings.
"""
course
=
CourseFactory
.
create
(
course_image
=
''
,
default_store
=
default_store
)
self
.
assertEquals
(
course_image
,
'static/test.png'
,
course_image_url
(
course
),
)
openedx/core/lib/tests/test_xblock_utils.py
View file @
8a6699a4
...
...
@@ -173,28 +173,6 @@ class TestXblockUtils(SharedModuleStoreTestCase):
self
.
assertIsInstance
(
test_replace
,
Fragment
)
self
.
assertEqual
(
test_replace
.
content
,
anchor_tag
)
@ddt.data
(
'course_mongo'
,
'course_split'
)
def
test_grade_histogram
(
self
,
course_id
):
"""
Verify that a histogram has been created.
"""
course
=
getattr
(
self
,
course_id
)
usage_key
=
course
.
id
.
make_usage_key
(
'problem'
,
'first_problem'
)
StudentModule
.
objects
.
create
(
student_id
=
1
,
grade
=
100
,
module_state_key
=
usage_key
)
StudentModule
.
objects
.
create
(
student_id
=
2
,
grade
=
50
,
module_state_key
=
usage_key
)
grades
=
grade_histogram
(
usage_key
)
self
.
assertEqual
(
grades
[
0
],
(
50.0
,
1
))
self
.
assertEqual
(
grades
[
1
],
(
100.0
,
1
))
def
test_sanitize_html_id
(
self
):
"""
Verify that colons and dashes are replaced.
...
...
pavelib/utils/test/suites/nose_suite.py
View file @
8a6699a4
...
...
@@ -150,6 +150,7 @@ class SystemTestSuite(NoseTestSuite):
" common/djangoapps/*"
" openedx/core/djangoapps/*"
" openedx/tests/*"
" openedx/core/lib/*"
)
if
self
.
root
in
(
'lms'
,
'cms'
):
...
...
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