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
4da3a035
Commit
4da3a035
authored
Oct 31, 2016
by
Matthew Piatetsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure data loader does not violate null constraint for mobile available field
parent
4ac7f58f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
course_discovery/apps/course_metadata/data_loaders/api.py
+1
-1
course_discovery/apps/course_metadata/data_loaders/tests/mock_data.py
+2
-2
course_discovery/apps/course_metadata/data_loaders/tests/test_api.py
+1
-1
No files found.
course_discovery/apps/course_metadata/data_loaders/api.py
View file @
4da3a035
...
...
@@ -157,7 +157,7 @@ class CoursesApiDataLoader(AbstractDataLoader):
'video'
:
self
.
get_courserun_video
(
body
),
'status'
:
CourseRunStatus
.
Published
,
'pacing_type'
:
self
.
get_pacing_type
(
body
),
'mobile_available'
:
body
.
get
(
'mobile_available'
),
'mobile_available'
:
body
.
get
(
'mobile_available'
)
or
False
,
})
course_run
,
__
=
course
.
course_runs
.
update_or_create
(
key__iexact
=
key
,
defaults
=
defaults
)
...
...
course_discovery/apps/course_metadata/data_loaders/tests/mock_data.py
View file @
4da3a035
...
...
@@ -38,7 +38,7 @@ COURSES_API_BODIES = [
'short_description'
:
''
,
'start'
:
'2015-06-15T13:00:00Z'
,
'pacing'
:
'self'
,
'mobile_available'
:
Fals
e
,
'mobile_available'
:
Tru
e
,
},
{
'effort'
:
None
,
...
...
@@ -83,7 +83,7 @@ COURSES_API_BODIES = [
'org'
:
'KyotoUx'
,
'short_description'
:
''
,
'start'
:
None
,
'mobile_available'
:
Fals
e
,
'mobile_available'
:
Non
e
,
},
]
...
...
course_discovery/apps/course_metadata/data_loaders/tests/test_api.py
View file @
4da3a035
...
...
@@ -178,7 +178,7 @@ class CoursesApiDataLoaderTests(ApiClientTestMixin, DataLoaderTestMixin, TestCas
'video'
:
self
.
loader
.
get_courserun_video
(
body
),
'status'
:
CourseRunStatus
.
Published
,
'pacing_type'
:
self
.
loader
.
get_pacing_type
(
body
),
'mobile_available'
:
body
[
'mobile_available'
],
'mobile_available'
:
body
[
'mobile_available'
]
or
False
,
})
for
field
,
value
in
expected_values
.
items
():
...
...
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