def test_no_missing(self):
     '''
     '''
     [CourseDailyMetricsFactory(
         date_for=self.date_for,
         course_id=course.id) for course in self.course_overviews]
     course_ids = pipeline_sdm.missing_course_daily_metrics(
         date_for=self.date_for)
     assert course_ids == set([])
 def test_missing(self):
     '''
     '''
     [
         CourseDailyMetricsFactory(
             date_for=self.date_for, course_id=self.course_overviews[0].id),
         CourseDailyMetricsFactory(
             date_for=self.date_for, course_id=self.course_overviews[1].id),
     ]
     expected_missing = [unicode(co.id) for co in self.course_overviews[2:]]
     actual = pipeline_sdm.missing_course_daily_metrics(date_for=self.date_for)
     assert actual == set(expected_missing)
    def test_missing(self):
        [
            CourseDailyMetricsFactory(date_for=self.date_for,
                                      site=self.site,
                                      course_id=self.course_overviews[0].id),
            CourseDailyMetricsFactory(date_for=self.date_for,
                                      site=self.site,
                                      course_id=self.course_overviews[1].id),
        ]
        expected_missing = [unicode(co.id) for co in self.course_overviews[2:]]
        actual = pipeline_sdm.missing_course_daily_metrics(
            site=self.site, date_for=self.date_for)

        assert set([str(obj) for obj in actual]) == set(expected_missing)