Commit 32e3b68b by Matthew Piatetsky Committed by GitHub

Merge pull request #411 from edx/ECOM-6252

ECOM-6252 Ensure data loader does not violate null constraint for mobile available flag
parents 4ac7f58f 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)
......
......@@ -38,7 +38,7 @@ COURSES_API_BODIES = [
'short_description': '',
'start': '2015-06-15T13:00:00Z',
'pacing': 'self',
'mobile_available': False,
'mobile_available': True,
},
{
'effort': None,
......@@ -83,7 +83,7 @@ COURSES_API_BODIES = [
'org': 'KyotoUx',
'short_description': '',
'start': None,
'mobile_available': False,
'mobile_available': None,
},
]
......
......@@ -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():
......
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