def test_author_get_display_name_with_type_translation(self): """ Test that the display name of an author with a type is correct (Translation) """ # GIVEN: An author author = Author() author.display_name = "John Doe" # WHEN: We call the get_display_name() function display_name = author.get_display_name(AuthorType.Translation) # THEN: It should return the name with the type in brackets self.assertEqual("John Doe (Translation)", display_name)
def test_author_get_display_name(self): """ Test that the display name of an author is correct """ # GIVEN: An author author = Author() author.display_name = "John Doe" # WHEN: We call the get_display_name() function display_name = author.get_display_name() # THEN: It should return only the name self.assertEqual("John Doe", display_name)
def test_author_get_display_name_with_type_words(self): """ Test that the display name of an author with a type is correct (Words) """ # GIVEN: An author author = Author() author.display_name = "John Doe" # WHEN: We call the get_display_name() function display_name = author.get_display_name(AuthorType.Words) # THEN: It should return the name with the type in brackets assert "John Doe (Words)" == display_name