Commit caab0b97 by Clinton Blackburn

Pulling the course start/end dates from Drupal (#116)

ECOM-4543
parent 3a983295
......@@ -348,9 +348,12 @@ class DrupalApiDataLoader(AbstractDataLoader):
except CourseRun.DoesNotExist:
logger.warning('Could not find course run [%s]', course_run_key)
return None
course_run.language = self.get_language_tag(body)
course_run.course = course
course_run.marketing_url = urljoin(settings.MARKETING_URL_ROOT, body['course_about_uri'])
course_run.start = self.parse_date(body['start'])
course_run.end = self.parse_date(body['end'])
self.set_staff(course_run, body)
......
......@@ -467,6 +467,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
'items': [
{
'title': self.EXISTING_COURSE_AND_RUN_DATA[0]['title'],
'start': '2015-06-15T13:00:00Z',
'end': '2015-12-15T13:00:00Z',
'level': {
'title': 'Introductory',
},
......@@ -502,6 +504,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
{
'title': self.EXISTING_COURSE_AND_RUN_DATA[1]['title'],
'start': '2015-06-15T13:00:00Z',
'end': '2015-12-15T13:00:00Z',
'level': {
'title': 'Intermediate',
},
......@@ -525,6 +529,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
{ # Create a course which exists in LMS/Otto, but without course runs
'title': self.EXISTING_COURSE['title'],
'start': '2015-06-15T13:00:00Z',
'end': '2015-12-15T13:00:00Z',
'level': {
'title': 'Advanced',
},
......@@ -551,6 +557,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
{ # Create a fake course run which doesn't exist in LMS/Otto
'title': 'A partial course',
'start': '2015-06-15T13:00:00Z',
'end': '2015-12-15T13:00:00Z',
'level': {
'title': 'Advanced',
},
......
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