forked from openlp/openlp
Add missing translationtype to song edit form
bzr-revno: 2462
This commit is contained in:
commit
46d9d60830
@ -84,13 +84,15 @@ class AuthorType(object):
|
|||||||
NoType,
|
NoType,
|
||||||
Words,
|
Words,
|
||||||
Music,
|
Music,
|
||||||
WordsAndMusic
|
WordsAndMusic,
|
||||||
|
Translation
|
||||||
]
|
]
|
||||||
TranslatedTypes = [
|
TranslatedTypes = [
|
||||||
Types[NoType],
|
Types[NoType],
|
||||||
Types[Words],
|
Types[Words],
|
||||||
Types[Music],
|
Types[Music],
|
||||||
Types[WordsAndMusic]
|
Types[WordsAndMusic],
|
||||||
|
Types[Translation]
|
||||||
]
|
]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -158,9 +158,9 @@ class TestDB(TestCase):
|
|||||||
# THEN: It should return only the name
|
# THEN: It should return only the name
|
||||||
self.assertEqual("John Doe", display_name)
|
self.assertEqual("John Doe", display_name)
|
||||||
|
|
||||||
def test_author_get_display_name_with_type(self):
|
def test_author_get_display_name_with_type_words(self):
|
||||||
"""
|
"""
|
||||||
Test that the display name of an author with a type is correct
|
Test that the display name of an author with a type is correct (Words)
|
||||||
"""
|
"""
|
||||||
# GIVEN: An author
|
# GIVEN: An author
|
||||||
author = Author()
|
author = Author()
|
||||||
@ -172,6 +172,20 @@ class TestDB(TestCase):
|
|||||||
# THEN: It should return the name with the type in brackets
|
# THEN: It should return the name with the type in brackets
|
||||||
self.assertEqual("John Doe (Words)", display_name)
|
self.assertEqual("John Doe (Words)", display_name)
|
||||||
|
|
||||||
|
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_upgrade_old_song_db(self):
|
def test_upgrade_old_song_db(self):
|
||||||
"""
|
"""
|
||||||
Test that we can upgrade an old song db to the current schema
|
Test that we can upgrade an old song db to the current schema
|
||||||
|
Loading…
Reference in New Issue
Block a user