Commit ceca1da3 by Waheed Ahmed

Fixed course creation.

parent 07aa3374
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment