def it_can_create_a_notes_master_part(self, create_fixture): package_, theme_part_, notes_master_part_ = create_fixture notes_master_part = NotesMasterPart.create_default(package_) NotesMasterPart._new.assert_called_once_with(package_) NotesMasterPart._new_theme_part.assert_called_once_with(package_) notes_master_part.relate_to.assert_called_once_with(theme_part_, RT.THEME) assert notes_master_part is notes_master_part_
def it_can_create_a_notes_master_part(self, create_fixture): package_, theme_part_, notes_master_part_ = create_fixture notes_master_part = NotesMasterPart.create_default(package_) NotesMasterPart._new.assert_called_once_with(package_) NotesMasterPart._new_theme_part.assert_called_once_with(package_) notes_master_part.relate_to.assert_called_once_with( theme_part_, RT.THEME) assert notes_master_part is notes_master_part_
def notes_master_part(self): """ Return the |NotesMasterPart| object for this presentation. If the presentation does not have a notes master, one is created from a default template. The same single instance is returned on each call. """ try: return self.part_related_by(RT.NOTES_MASTER) except KeyError: notes_master_part = NotesMasterPart.create_default(self.package) self.relate_to(notes_master_part, RT.NOTES_MASTER) return notes_master_part
def it_can_create_a_notes_master_part( self, request, package_, notes_master_part_, theme_part_ ): method_mock( request, NotesMasterPart, "_new", autospec=False, return_value=notes_master_part_, ) method_mock( request, NotesMasterPart, "_new_theme_part", autospec=False, return_value=theme_part_, ) notes_master_part = NotesMasterPart.create_default(package_) NotesMasterPart._new.assert_called_once_with(package_) NotesMasterPart._new_theme_part.assert_called_once_with(package_) notes_master_part.relate_to.assert_called_once_with(theme_part_, RT.THEME) assert notes_master_part is notes_master_part_