def update_bibliography_changed_field_in_cms(learning_unit_year): txt_label = text_label.get_by_label_or_none('bibliography') if txt_label: for language in settings.LANGUAGES: translated_text.update_or_create( entity=entity_name.LEARNING_UNIT_YEAR, reference=learning_unit_year.id, text_label=txt_label, language=language[0], defaults={})
def test_get_by_label_or_none(self): text_labels = text_label.TextLabel.objects.all() text_labels.delete() self.assertIsNone(text_label.get_by_label_or_none('random'))