Esempio n. 1
0
def get_evaluation(education_group_year, language_code):
    try:
        label, text = get_evaluation_text(education_group_year, language_code)
    except TranslatedText.DoesNotExist:
        label = text = None

    common_text = get_common_evaluation_text(education_group_year, language_code)

    return {
        'id': business.EVALUATION_KEY,
        'label': label,
        'content': common_text,
        'free_text': text
    }
Esempio n. 2
0
 def test_get__common_evaluation_no_english_version(self):
     with self.assertRaises(TranslatedText.DoesNotExist):
         business.get_common_evaluation_text(self.education_group_year, settings.LANGUAGE_CODE_EN)
Esempio n. 3
0
 def test_get_common_evaluation_french_version(self):
     text = business.get_common_evaluation_text(self.education_group_year, settings.LANGUAGE_CODE_FR)
     self.assertEqual(text, self.common.text)