'Check that course structure is generated after course published signal is sent'

def test_course_structure_generated(self):

    ccx_structure = {u'blocks': {u'ccx-block-v1:edX+999+Run_666+ccx@1+type@course+block@course': {u'block_type': u'course', u'graded': False, u'format': None, u'usage_key': u'ccx-block-v1:edX+999+Run_666+ccx@1+type@course+block@course', u'children': [], u'display_name': u'Run    666'}}, u'root': u'ccx-block-v1:edX+999+Run_666+ccx@1+type@course+block@course'}
    course_key = CCXLocator.from_course_locator(self.course.id, self.ccx.id)
    structure = CourseStructure.objects.filter(course_id=course_key)
    self.assertEqual(len(structure), 0)
    with mock_signal_receiver(SignalHandler.course_published) as receiver:
        self.call_fut(self.course.id)
        self.assertEqual(receiver.call_count, 3)
        structure = CourseStructure.objects.get(course_id=course_key)
        self.assertEqual(structure.structure, ccx_structure)
