Commit ca1553b0 by tasawernawaz Committed by Tasawer Nawaz

Make "lms_course_id" required field before starting approval workflow.

ECOM-7358
parent 785bdbcf
...@@ -256,6 +256,8 @@ class CourseRunStateSerializerTests(TestCase): ...@@ -256,6 +256,8 @@ class CourseRunStateSerializerTests(TestCase):
) )
self.assertNotEqual(self.run_state, CourseRunStateChoices.Review) self.assertNotEqual(self.run_state, CourseRunStateChoices.Review)
self.course_run.lms_course_id = 'course-v1:edX+DemoX+Demo_Course'
serializer = self.serializer_class(self.run_state, context={'request': self.request}) serializer = self.serializer_class(self.run_state, context={'request': self.request})
data = {'name': CourseRunStateChoices.Review} data = {'name': CourseRunStateChoices.Review}
serializer.update(self.run_state, data) serializer.update(self.run_state, data)
......
...@@ -553,6 +553,7 @@ class ChangeCourseRunStateViewTests(TestCase): ...@@ -553,6 +553,7 @@ class ChangeCourseRunStateViewTests(TestCase):
language_tag.save() language_tag.save()
self.course_run.transcript_languages.add(language_tag) self.course_run.transcript_languages.add(language_tag)
self.course_run.language = language_tag self.course_run.language = language_tag
self.course_run.lms_course_id = 'course-v1:edX+DemoX+Demo_Course'
self.course_run.save() self.course_run.save()
self.course_run.staff.add(PersonFactory()) self.course_run.staff.add(PersonFactory())
......
...@@ -550,7 +550,8 @@ class CourseRunState(TimeStampedModel, ChangedByMixin): ...@@ -550,7 +550,8 @@ class CourseRunState(TimeStampedModel, ChangedByMixin):
return all([ return all([
course_run.course.course_state.is_approved, course_run.has_valid_seats, course_run.start, course_run.end, course_run.course.course_state.is_approved, course_run.has_valid_seats, course_run.start, course_run.end,
course_run.pacing_type, course_run.has_valid_staff, course_run.is_valid_micromasters, course_run.pacing_type, course_run.has_valid_staff, course_run.is_valid_micromasters,
course_run.is_valid_xseries, course_run.language, course_run.transcript_languages.all() course_run.is_valid_xseries, course_run.language, course_run.transcript_languages.all(),
course_run.lms_course_id
]) ])
def __str__(self): def __str__(self):
......
...@@ -542,6 +542,7 @@ class CourseRunStateTests(TestCase): ...@@ -542,6 +542,7 @@ class CourseRunStateTests(TestCase):
self.course_run.language = language_tag self.course_run.language = language_tag
self.course_run.is_micromasters = True self.course_run.is_micromasters = True
self.course_run.micromasters_name = 'test' self.course_run.micromasters_name = 'test'
self.course_run.lms_course_id = 'course-v1:edX+DemoX+Demo_Course'
self.course_run.save() self.course_run.save()
self.course.course_state.name = CourseStateChoices.Approved self.course.course_state.name = CourseStateChoices.Approved
self.course.save() self.course.save()
......
...@@ -504,6 +504,8 @@ class CourseRunDetailTests(TestCase): ...@@ -504,6 +504,8 @@ class CourseRunDetailTests(TestCase):
self.user.groups.add(Group.objects.get(name=ADMIN_GROUP_NAME)) self.user.groups.add(Group.objects.get(name=ADMIN_GROUP_NAME))
self.client.login(username=self.user.username, password=USER_PASSWORD) self.client.login(username=self.user.username, password=USER_PASSWORD)
self.course_run = factories.CourseRunFactory(course=self.course) self.course_run = factories.CourseRunFactory(course=self.course)
self.course_run.lms_course_id = 'course-v1:edX+DemoX+Demo_Course'
self.course_run.save()
self.organization_extension = factories.OrganizationExtensionFactory() self.organization_extension = factories.OrganizationExtensionFactory()
self.course.organizations.add(self.organization_extension.organization) self.course.organizations.add(self.organization_extension.organization)
......
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