This commit is contained in:
Andreas Preikschat 2013-06-21 20:13:59 +02:00
parent 6265ce93de
commit 4f8d93638b
2 changed files with 6 additions and 8 deletions

View File

@ -701,7 +701,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
for index in range(self.verse_list_widget.rowCount()): for index in range(self.verse_list_widget.rowCount()):
verse = self.verse_list_widget.item(index, 0) verse = self.verse_list_widget.item(index, 0)
verse = verse.data(QtCore.Qt.UserRole) verse = verse.data(QtCore.Qt.UserRole)
print(verse)
if verse not in verses_in_order: if verse not in verses_in_order:
verses_not_used.append(verse) verses_not_used.append(verse)
# Set the label text. # Set the label text.

View File

@ -64,8 +64,7 @@ class TestEditSongForm(TestCase):
# WHEN: Call the method. # WHEN: Call the method.
self.form.on_verse_order_text_changed(given_verse_order) self.form.on_verse_order_text_changed(given_verse_order)
# THEN: The warning lable should be hidden. # THEN: No text should be shown.
print self.form.warning_label.text()
assert self.form.warning_label.text() == u'', u'There should be no warning.' assert self.form.warning_label.text() == u'', u'There should be no warning.'
def verse_order_incomplete_warning_test(self): def verse_order_incomplete_warning_test(self):
@ -86,8 +85,8 @@ class TestEditSongForm(TestCase):
# WHEN: Call the method. # WHEN: Call the method.
self.form.on_verse_order_text_changed(given_verse_order) self.form.on_verse_order_text_changed(given_verse_order)
# THEN: The warning lable should be hidden. # THEN: The verse-order-incomplete text should be shown.
assert self.form.warning_label.text() == u'<strong>Warning:</strong> Not all of the verses are in use.', \ assert self.form.warning_label.text() == self.form.not_all_verses_used_warning, \
u'The verse-order-incomplete warning should be shown.' u'The verse-order-incomplete warning should be shown.'
def bug_1170435_test(self): def bug_1170435_test(self):
@ -101,11 +100,11 @@ class TestEditSongForm(TestCase):
mocked_verse = MagicMock() mocked_verse = MagicMock()
mocked_verse.data = MagicMock(return_value=u'V1') mocked_verse.data = MagicMock(return_value=u'V1')
self.form.verse_list_widget.item = MagicMock(return_value=mocked_verse) self.form.verse_list_widget.item = MagicMock(return_value=mocked_verse)
self.form._extract_verse_order = MagicMock(return_value=[given_verse_order]) self.form._extract_verse_order = MagicMock(return_value=[])
self.form.verse_order_edit.text = MagicMock(return_value=given_verse_order) self.form.verse_order_edit.text = MagicMock(return_value=given_verse_order)
# WHEN: Call the method. # WHEN: Call the method.
self.form.on_verse_order_text_changed(given_verse_order) self.form.on_verse_order_text_changed(given_verse_order)
# THEN: The warning lable should be hidden. # THEN: The no-verse-order message should be shown.
assert self.form.warning_label.text() == u'<strong>Warning:</strong> You have not entered a verse order.', \ assert self.form.warning_label.text() == self.form.no_verse_order_entered_warning, \
u'The no-verse-order message should be shown.' u'The no-verse-order message should be shown.'