This commit is contained in:
Samuel Mehrbrodt 2014-05-07 12:25:36 +02:00
parent aaacbeac69
commit ee7a8b9804
2 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ class SongSelectImport(object):
db_song.lyrics = song_xml.extract_xml()
clean_song(self.db_manager, db_song)
self.db_manager.save_object(db_song)
db_song.authors = []
db_song.authors_songs = []
for author_name in song['authors']:
author = self.db_manager.get_object_filtered(Author, Author.display_name == author_name)
if not author:

View File

@ -344,7 +344,7 @@ class TestSongSelect(TestCase):
mocked_db_manager.get_object_filtered.assert_called_with(MockedAuthor, False)
MockedAuthor.populate.assert_called_with(first_name='Public', last_name='Domain',
display_name='Public Domain')
self.assertEqual(1, len(result.authors), 'There should only be one author')
self.assertEqual(1, len(result.authors_songs), 'There should only be one author')
def save_song_existing_author_test(self):
"""
@ -379,4 +379,4 @@ class TestSongSelect(TestCase):
'The save_object() method should have been called twice')
mocked_db_manager.get_object_filtered.assert_called_with(MockedAuthor, False)
self.assertEqual(0, MockedAuthor.populate.call_count, 'A new author should not have been instantiated')
self.assertEqual(1, len(result.authors), 'There should only be one author')
self.assertEqual(1, len(result.authors_songs), 'There should only be one author')