← Back to team overview

openlp-core team mailing list archive

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

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/bug-1405164 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1405164 in OpenLP: "Missing "translation" type from "Edit Author Type" dialog"
  https://bugs.launchpad.net/openlp/+bug/1405164

For more details, see:
https://code.launchpad.net/~sam92/openlp/bug-1405164/+merge/245360

Add missing translation type to song edit form

lp:~sam92/openlp/bug-1405164 (revision 2462)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/832/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/764/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/710/
[FAILURE] http://ci.openlp.org/job/Branch-04a-Windows_Functional_Tests/614/
Stopping after failure
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/bug-1405164 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/db.py'
--- openlp/plugins/songs/lib/db.py	2014-09-14 13:35:55 +0000
+++ openlp/plugins/songs/lib/db.py	2014-12-24 13:31:55 +0000
@@ -84,13 +84,15 @@
         NoType,
         Words,
         Music,
-        WordsAndMusic
+        WordsAndMusic,
+        Translation
     ]
     TranslatedTypes = [
         Types[NoType],
         Types[Words],
         Types[Music],
-        Types[WordsAndMusic]
+        Types[WordsAndMusic],
+        Types[Translation]
     ]
 
     @staticmethod

=== modified file 'tests/functional/openlp_plugins/songs/test_db.py'
--- tests/functional/openlp_plugins/songs/test_db.py	2014-11-25 14:11:18 +0000
+++ tests/functional/openlp_plugins/songs/test_db.py	2014-12-24 13:31:55 +0000
@@ -158,9 +158,9 @@
         # THEN: It should return only the 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
         author = Author()
@@ -172,6 +172,20 @@
         # THEN: It should return the name with the type in brackets
         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):
         """
         Test that we can upgrade an old song db to the current schema


References