Merge lp:~sam92/openlp/bug-1405164 into lp:openlp

Proposed by Samuel Mehrbrodt
Status: Merged
Approved by: Raoul Snyman
Approved revision: 2462
Merged at revision: 2462
Proposed branch: lp:~sam92/openlp/bug-1405164
Merge into: lp:openlp
Diff against target: 58 lines (+20/-4)
2 files modified
openlp/plugins/songs/lib/db.py (+4/-2)
tests/functional/openlp_plugins/songs/test_db.py (+16/-2)
To merge this branch: bzr merge lp:~sam92/openlp/bug-1405164
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Tim Bentley Approve
Review via email: mp+245360@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/plugins/songs/lib/db.py'
2--- openlp/plugins/songs/lib/db.py 2014-09-14 13:35:55 +0000
3+++ openlp/plugins/songs/lib/db.py 2014-12-24 13:31:55 +0000
4@@ -84,13 +84,15 @@
5 NoType,
6 Words,
7 Music,
8- WordsAndMusic
9+ WordsAndMusic,
10+ Translation
11 ]
12 TranslatedTypes = [
13 Types[NoType],
14 Types[Words],
15 Types[Music],
16- Types[WordsAndMusic]
17+ Types[WordsAndMusic],
18+ Types[Translation]
19 ]
20
21 @staticmethod
22
23=== modified file 'tests/functional/openlp_plugins/songs/test_db.py'
24--- tests/functional/openlp_plugins/songs/test_db.py 2014-11-25 14:11:18 +0000
25+++ tests/functional/openlp_plugins/songs/test_db.py 2014-12-24 13:31:55 +0000
26@@ -158,9 +158,9 @@
27 # THEN: It should return only the name
28 self.assertEqual("John Doe", display_name)
29
30- def test_author_get_display_name_with_type(self):
31+ def test_author_get_display_name_with_type_words(self):
32 """
33- Test that the display name of an author with a type is correct
34+ Test that the display name of an author with a type is correct (Words)
35 """
36 # GIVEN: An author
37 author = Author()
38@@ -172,6 +172,20 @@
39 # THEN: It should return the name with the type in brackets
40 self.assertEqual("John Doe (Words)", display_name)
41
42+ def test_author_get_display_name_with_type_translation(self):
43+ """
44+ Test that the display name of an author with a type is correct (Translation)
45+ """
46+ # GIVEN: An author
47+ author = Author()
48+ author.display_name = "John Doe"
49+
50+ # WHEN: We call the get_display_name() function
51+ display_name = author.get_display_name(AuthorType.Translation)
52+
53+ # THEN: It should return the name with the type in brackets
54+ self.assertEqual("John Doe (Translation)", display_name)
55+
56 def test_upgrade_old_song_db(self):
57 """
58 Test that we can upgrade an old song db to the current schema