def handle(self, *args, **options):
        file_name = options['load_surveys'][0]
        absolute_file_name = os.path.join(str(root), file_name)

        with open(absolute_file_name, 'r') as survey_to_load:
            loader = SurveyLoader(survey_to_load.read())
            loader.load_survey()
    def load_survey_test(self):
        loader = SurveyLoader(sample_survey)
        loader.load_survey()

        all_surveys = Survey.objects.all()
        all_questions = Question.objects.all()

        assert len(all_surveys) == 1
        assert len(all_questions) == 5
        assert all_surveys.first().title == 'About bears'

        with pytest.raises(KeyError):
            loader = SurveyLoader(broken_survey)
            loader.load_survey()