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
caab0b97
Commit
caab0b97
authored
May 26, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pulling the course start/end dates from Drupal (#116)
ECOM-4543
parent
3a983295
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
course_discovery/apps/course_metadata/data_loaders.py
+3
-0
course_discovery/apps/course_metadata/tests/test_data_loaders.py
+8
-0
No files found.
course_discovery/apps/course_metadata/data_loaders.py
View file @
caab0b97
...
@@ -348,9 +348,12 @@ class DrupalApiDataLoader(AbstractDataLoader):
...
@@ -348,9 +348,12 @@ class DrupalApiDataLoader(AbstractDataLoader):
except
CourseRun
.
DoesNotExist
:
except
CourseRun
.
DoesNotExist
:
logger
.
warning
(
'Could not find course run [
%
s]'
,
course_run_key
)
logger
.
warning
(
'Could not find course run [
%
s]'
,
course_run_key
)
return
None
return
None
course_run
.
language
=
self
.
get_language_tag
(
body
)
course_run
.
language
=
self
.
get_language_tag
(
body
)
course_run
.
course
=
course
course_run
.
course
=
course
course_run
.
marketing_url
=
urljoin
(
settings
.
MARKETING_URL_ROOT
,
body
[
'course_about_uri'
])
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
)
self
.
set_staff
(
course_run
,
body
)
...
...
course_discovery/apps/course_metadata/tests/test_data_loaders.py
View file @
caab0b97
...
@@ -467,6 +467,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
...
@@ -467,6 +467,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
'items'
:
[
'items'
:
[
{
{
'title'
:
self
.
EXISTING_COURSE_AND_RUN_DATA
[
0
][
'title'
],
'title'
:
self
.
EXISTING_COURSE_AND_RUN_DATA
[
0
][
'title'
],
'start'
:
'2015-06-15T13:00:00Z'
,
'end'
:
'2015-12-15T13:00:00Z'
,
'level'
:
{
'level'
:
{
'title'
:
'Introductory'
,
'title'
:
'Introductory'
,
},
},
...
@@ -502,6 +504,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
...
@@ -502,6 +504,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
},
{
{
'title'
:
self
.
EXISTING_COURSE_AND_RUN_DATA
[
1
][
'title'
],
'title'
:
self
.
EXISTING_COURSE_AND_RUN_DATA
[
1
][
'title'
],
'start'
:
'2015-06-15T13:00:00Z'
,
'end'
:
'2015-12-15T13:00:00Z'
,
'level'
:
{
'level'
:
{
'title'
:
'Intermediate'
,
'title'
:
'Intermediate'
,
},
},
...
@@ -525,6 +529,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
...
@@ -525,6 +529,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
},
{
# Create a course which exists in LMS/Otto, but without course runs
{
# Create a course which exists in LMS/Otto, but without course runs
'title'
:
self
.
EXISTING_COURSE
[
'title'
],
'title'
:
self
.
EXISTING_COURSE
[
'title'
],
'start'
:
'2015-06-15T13:00:00Z'
,
'end'
:
'2015-12-15T13:00:00Z'
,
'level'
:
{
'level'
:
{
'title'
:
'Advanced'
,
'title'
:
'Advanced'
,
},
},
...
@@ -551,6 +557,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
...
@@ -551,6 +557,8 @@ class DrupalApiDataLoaderTests(DataLoaderTestMixin, TestCase):
},
},
{
# Create a fake course run which doesn't exist in LMS/Otto
{
# Create a fake course run which doesn't exist in LMS/Otto
'title'
:
'A partial course'
,
'title'
:
'A partial course'
,
'start'
:
'2015-06-15T13:00:00Z'
,
'end'
:
'2015-12-15T13:00:00Z'
,
'level'
:
{
'level'
:
{
'title'
:
'Advanced'
,
'title'
:
'Advanced'
,
},
},
...
...
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