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
4a530690
Commit
4a530690
authored
Dec 04, 2015
by
Nimisha Asthagiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused "has_cert_config" field on CourseDetails.
parent
91153aea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 additions
and
59 deletions
+1
-59
cms/djangoapps/contentstore/tests/test_course_settings.py
+0
-34
cms/static/js/spec/views/settings/main_spec.js
+1
-2
openedx/core/djangoapps/models/course_details.py
+0
-22
openedx/core/djangoapps/models/tests/test_course_details.py
+0
-1
No files found.
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
4a530690
...
...
@@ -982,40 +982,6 @@ class CourseMetadataEditingTest(CourseTestCase):
tab_list
.
append
(
self
.
notes_tab
)
self
.
assertEqual
(
tab_list
,
course
.
tabs
)
@override_settings
(
FEATURES
=
{
'CERTIFICATES_HTML_VIEW'
:
True
})
def
test_web_view_certificate_configuration_settings
(
self
):
"""
Test that has_cert_config is updated based on cert_html_view_enabled setting.
"""
test_model
=
CourseMetadata
.
update_from_json
(
self
.
course
,
{
"cert_html_view_enabled"
:
{
"value"
:
"true"
}
},
user
=
self
.
user
)
self
.
assertIn
(
'cert_html_view_enabled'
,
test_model
)
url
=
get_url
(
self
.
course
.
id
)
response
=
self
.
client
.
get_json
(
url
)
course_detail_json
=
json
.
loads
(
response
.
content
)
self
.
assertFalse
(
course_detail_json
[
'has_cert_config'
])
# Now add a certificate configuration
certificates
=
[
{
'id'
:
1
,
'name'
:
'Certificate Config Name'
,
'course_title'
:
'Title override'
,
'signatories'
:
[],
'is_active'
:
True
}
]
self
.
course
.
certificates
=
{
'certificates'
:
certificates
}
modulestore
()
.
update_item
(
self
.
course
,
self
.
user
.
id
)
response
=
self
.
client
.
get_json
(
url
)
course_detail_json
=
json
.
loads
(
response
.
content
)
self
.
assertTrue
(
course_detail_json
[
'has_cert_config'
])
class
CourseGraderUpdatesTest
(
CourseTestCase
):
"""
...
...
cms/static/js/spec/views/settings/main_spec.js
View file @
4a530690
...
...
@@ -31,8 +31,7 @@ define([
entrance_exam_enabled
:
''
,
entrance_exam_minimum_score_pct
:
'50'
,
license
:
null
,
language
:
''
,
has_cert_config
:
false
language
:
''
},
mockSettingsPage
=
readFixtures
(
'mock/mock-settings-page.underscore'
);
...
...
openedx/core/djangoapps/models/course_details.py
View file @
4a530690
...
...
@@ -57,7 +57,6 @@ class CourseDetails(object):
'ENTRANCE_EXAM_MIN_SCORE_PCT'
,
'50'
)
# minimum passing score for entrance exam content module/tree,
self
.
has_cert_config
=
None
# course has active certificate configuration
self
.
self_paced
=
None
@classmethod
...
...
@@ -94,7 +93,6 @@ class CourseDetails(object):
# Default course license is "All Rights Reserved"
course_details
.
license
=
getattr
(
descriptor
,
"license"
,
"all-rights-reserved"
)
course_details
.
has_cert_config
=
has_active_web_certificate
(
descriptor
)
course_details
.
intro_video
=
cls
.
fetch_youtube_video_id
(
course_key
)
for
attribute
in
ABOUT_ATTRIBUTES
:
...
...
@@ -290,23 +288,3 @@ class CourseDetails(object):
'?rel=0" frameborder="0" allowfullscreen=""></iframe>'
)
return
result
# TODO - we may no longer need this - check with Zia
def
has_active_web_certificate
(
course
):
"""
Returns True if given course has active web certificate
configuration. If given course has no active web certificate
configuration returns False. Returns None If `CERTIFICATES_HTML_VIEW`
is not enabled or course has not enabled `cert_html_view_enabled`
settings.
"""
cert_config
=
None
if
settings
.
FEATURES
.
get
(
'CERTIFICATES_HTML_VIEW'
,
False
)
and
course
.
cert_html_view_enabled
:
cert_config
=
False
certificates
=
getattr
(
course
,
'certificates'
,
{})
configurations
=
certificates
.
get
(
'certificates'
,
[])
for
config
in
configurations
:
if
config
.
get
(
'is_active'
):
return
True
return
cert_config
openedx/core/djangoapps/models/tests/test_course_details.py
View file @
4a530690
...
...
@@ -39,7 +39,6 @@ class CourseDetailsTestCase(ModuleStoreTestCase):
self
.
assertIsNone
(
details
.
intro_video
,
"intro_video somehow initialized"
+
str
(
details
.
intro_video
))
self
.
assertIsNone
(
details
.
effort
,
"effort somehow initialized"
+
str
(
details
.
effort
))
self
.
assertIsNone
(
details
.
language
,
"language somehow initialized"
+
str
(
details
.
language
))
self
.
assertIsNone
(
details
.
has_cert_config
)
self
.
assertFalse
(
details
.
self_paced
)
def
test_update_and_fetch
(
self
):
...
...
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