Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
ceca1da3
Commit
ceca1da3
authored
Jan 24, 2017
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed course creation.
parent
07aa3374
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
17 deletions
+2
-17
course_discovery/apps/publisher/forms.py
+1
-1
course_discovery/apps/publisher/tests/test_views.py
+1
-16
No files found.
course_discovery/apps/publisher/forms.py
View file @
ceca1da3
...
...
@@ -204,7 +204,7 @@ class CustomCourseRunForm(CourseRunForm):
'length'
,
'transcript_languages'
,
'language'
,
'min_effort'
,
'max_effort'
,
'contacted_partner_manager'
,
'target_content'
,
'pacing_type'
,
'video_language'
,
'staff'
,
'start'
,
'end'
,
'is_xseries'
,
'xseries_name'
,
'is_micromasters'
,
'micromasters_name'
,
'lms_course_id'
,
'micromasters_name'
,
)
def
save
(
self
,
commit
=
True
,
course
=
None
,
changed_by
=
None
):
# pylint: disable=arguments-differ
...
...
course_discovery/apps/publisher/tests/test_views.py
View file @
ceca1da3
...
...
@@ -526,10 +526,6 @@ class CreateUpdateCourseRunViewTests(TestCase):
def
test_update_course_run_with_internal_user
(
self
):
""" Verify that internal user can update an existing course run. """
updated_lms_course_id
=
'course-v1:testX+AS121+2018_q1'
self
.
course_run_dict
[
'lms_course_id'
]
=
updated_lms_course_id
self
.
assertNotEqual
(
self
.
course_run
.
lms_course_id
,
updated_lms_course_id
)
self
.
assertNotEqual
(
self
.
course_run
.
changed_by
,
self
.
user
)
self
.
user
.
groups
.
add
(
Group
.
objects
.
get
(
name
=
INTERNAL_USER_GROUP_NAME
))
response
=
self
.
client
.
post
(
...
...
@@ -545,8 +541,6 @@ class CreateUpdateCourseRunViewTests(TestCase):
)
course_run
=
CourseRun
.
objects
.
get
(
id
=
self
.
course_run
.
id
)
# Assert that course run is updated.
self
.
assertEqual
(
course_run
.
lms_course_id
,
updated_lms_course_id
)
self
.
assertEqual
(
course_run
.
changed_by
,
self
.
user
)
# add new and check the comment on edit page.
...
...
@@ -560,10 +554,6 @@ class CreateUpdateCourseRunViewTests(TestCase):
""" Verify that non internal user can't access course run edit page without permission. """
non_internal_user
,
__
=
create_non_staff_user_and_login
(
self
)
updated_lms_course_id
=
'course-v1:testX+AS121+2018_q1'
self
.
course_run_dict
[
'lms_course_id'
]
=
updated_lms_course_id
self
.
assertNotEqual
(
self
.
course_run
.
lms_course_id
,
updated_lms_course_id
)
response
=
self
.
client
.
get
(
reverse
(
'publisher:publisher_course_runs_edit'
,
kwargs
=
{
'pk'
:
self
.
course_run
.
id
})
)
...
...
@@ -582,10 +572,6 @@ class CreateUpdateCourseRunViewTests(TestCase):
""" Test for course run with non internal user. """
non_internal_user
,
__
=
create_non_staff_user_and_login
(
self
)
updated_lms_course_id
=
'course-v1:testX+AS121+2018_q1'
self
.
course_run_dict
[
'lms_course_id'
]
=
updated_lms_course_id
self
.
assertNotEqual
(
self
.
course_run
.
lms_course_id
,
updated_lms_course_id
)
response
=
self
.
client
.
post
(
reverse
(
'publisher:publisher_course_runs_edit'
,
kwargs
=
{
'pk'
:
self
.
course_run
.
id
}),
self
.
course_run_dict
...
...
@@ -609,8 +595,7 @@ class CreateUpdateCourseRunViewTests(TestCase):
)
course_run
=
CourseRun
.
objects
.
get
(
id
=
self
.
course_run
.
id
)
# Assert that course run is updated.
self
.
assertEqual
(
course_run
.
lms_course_id
,
updated_lms_course_id
)
self
.
assertEqual
(
course_run
.
changed_by
,
non_internal_user
)
# add new and check the comment on edit page.
comment
=
CommentFactory
(
content_object
=
self
.
course_run
,
user
=
self
.
user
,
site
=
self
.
site
)
...
...
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