'Test that a course is created successfully'

@mock.patch('contentstore.management.commands.generate_courses.logger')
def test_generate_course_in_stores(self, mock_logger):

    settings = {'courses': [{'organization': 'test-course-generator', 'number': '1', 'run': '1', 'user': str(self.user.email), 'fields': {'display_name': 'test-course', 'announcement': '2010-04-20T20:08:21.634121'}}]}
    arg = json.dumps(settings)
    call_command('generate_courses', arg)
    key = modulestore().make_course_key('test-course-generator', '1', '1')
    self.assertTrue(modulestore().has_course(key))
    mock_logger.info.assert_any_call('Created    course-v1:test-course-generator+1+1')
    mock_logger.info.assert_any_call('announcement    has    been    set    to    2010-04-20T20:08:21.634121')
    mock_logger.info.assert_any_call('display_name    has    been    set    to    test-course')
