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
fab6e003
Commit
fab6e003
authored
Nov 10, 2015
by
Matt Drayer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10417 from edx/ziafazal/SOL-1358
ziafazal/SOL-1358: enabled web certs by default for all new courses
parents
23ef9891
cbc57aae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
+23
-0
cms/djangoapps/contentstore/views/course.py
+5
-2
No files found.
cms/djangoapps/contentstore/tests/test_course_create_rerun.py
View file @
fab6e003
"""
Test view handler for rerun (and eventually create)
"""
import
ddt
from
django.test.client
import
RequestFactory
from
opaque_keys.edx.keys
import
CourseKey
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.django
import
modulestore
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
from
student.tests.factories
import
UserFactory
from
contentstore.tests.utils
import
AjaxEnabledTestClient
,
parse_json
...
...
@@ -13,6 +17,7 @@ from datetime import datetime
from
xmodule.course_module
import
CourseFields
@ddt.ddt
class
TestCourseListing
(
ModuleStoreTestCase
):
"""
Unit tests for getting the list of courses for a logged in user
...
...
@@ -64,3 +69,21 @@ class TestCourseListing(ModuleStoreTestCase):
self
.
assertEqual
(
dest_course_key
.
run
,
'copy'
)
dest_course
=
self
.
store
.
get_course
(
dest_course_key
)
self
.
assertEqual
(
dest_course
.
start
,
CourseFields
.
start
.
default
)
@ddt.data
(
ModuleStoreEnum
.
Type
.
mongo
,
ModuleStoreEnum
.
Type
.
split
)
def
test_newly_created_course_has_web_certs_enabled
(
self
,
store
):
"""
Tests newly created course has web certs enabled by default.
"""
with
modulestore
()
.
default_store
(
store
):
response
=
self
.
client
.
ajax_post
(
'/course/'
,
{
'org'
:
'orgX'
,
'number'
:
'CS101'
,
'display_name'
:
'Course with web certs enabled'
,
'run'
:
'2015_T2'
})
self
.
assertEqual
(
response
.
status_code
,
200
)
data
=
parse_json
(
response
)
new_course_key
=
CourseKey
.
from_string
(
data
[
'course_key'
])
course
=
self
.
store
.
get_course
(
new_course_key
)
self
.
assertTrue
(
course
.
cert_html_view_enabled
)
cms/djangoapps/contentstore/views/course.py
View file @
fab6e003
...
...
@@ -741,8 +741,11 @@ def create_new_course_in_store(store, user, org, number, run, fields):
Separated out b/c command line course creation uses this as well as the web interface.
"""
# Set default language from settings
fields
.
update
({
'language'
:
getattr
(
settings
,
'DEFAULT_COURSE_LANGUAGE'
,
'en'
)})
# Set default language from settings and enable web certs
fields
.
update
({
'language'
:
getattr
(
settings
,
'DEFAULT_COURSE_LANGUAGE'
,
'en'
),
'cert_html_view_enabled'
:
True
,
})
with
modulestore
()
.
default_store
(
store
):
# Creating the course raises DuplicateCourseError if an existing course with this org/name is found
...
...
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