forked from openlp/openlp
fix field names
This commit is contained in:
parent
7efe1320fb
commit
c2692b76ea
@ -40,8 +40,8 @@ class TestStartNoteDialog(TestCase):
|
||||
# WHEN displaying the UI and pressing enter
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the following input text is returned
|
||||
self.assertEqual(self.form.text_edit.toPlainText(), u'', u'The returned text should be empty')
|
||||
@ -51,8 +51,8 @@ class TestStartNoteDialog(TestCase):
|
||||
self.form.text_edit.setPlainText(text)
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Save)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the following text is returned
|
||||
self.assertEqual(self.form.text_edit.toPlainText(), text, u'The text originally entered should still be there')
|
||||
|
@ -49,8 +49,8 @@ class TestSettingsForm(TestCase):
|
||||
|
||||
# WHEN displaying the UI and pressing cancel
|
||||
with patch(u'PyQt4.QtGui.QDialog.reject') as mocked_reject:
|
||||
cancelWidget = self.form.button_box.button(self.form.button_box.Cancel)
|
||||
QtTest.QTest.mouseClick(cancelWidget, QtCore.Qt.LeftButton)
|
||||
cancel_widget = self.form.button_box.button(self.form.button_box.Cancel)
|
||||
QtTest.QTest.mouseClick(cancel_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the dialog reject should have been called
|
||||
assert mocked_reject.call_count == 1, u'The QDialog.reject should have been called'
|
||||
@ -63,8 +63,8 @@ class TestSettingsForm(TestCase):
|
||||
|
||||
# WHEN displaying the UI and pressing Ok
|
||||
with patch(u'PyQt4.QtGui.QDialog.accept') as mocked_accept:
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the dialog reject should have been called
|
||||
assert mocked_accept.call_count == 1, u'The QDialog.accept should have been called'
|
||||
@ -78,8 +78,8 @@ class TestSettingsForm(TestCase):
|
||||
|
||||
# WHEN displaying the UI and pressing Ok
|
||||
with patch(u'PyQt4.QtGui.QDialog.accept'):
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the processing stack should be empty
|
||||
assert len(self.form.processes) == 0, u'The one requested process should have been removed from the stack'
|
||||
|
@ -72,8 +72,8 @@ class TestStartTimeDialog(TestCase):
|
||||
self.form.item = {u'service_item': mocked_serviceitem}
|
||||
with patch(u'PyQt4.QtGui.QDialog.exec_'):
|
||||
self.form.exec_()
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the following input values are returned
|
||||
self.assertEqual(self.form.hourSpinBox.value(), 0)
|
||||
@ -87,8 +87,8 @@ class TestStartTimeDialog(TestCase):
|
||||
self.form.exec_()
|
||||
self.form.minuteSpinBox.setValue(2)
|
||||
self.form.secondSpinBox.setValue(3)
|
||||
okWidget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(okWidget, QtCore.Qt.LeftButton)
|
||||
ok_widget = self.form.button_box.button(self.form.button_box.Ok)
|
||||
QtTest.QTest.mouseClick(ok_widget, QtCore.Qt.LeftButton)
|
||||
|
||||
# THEN the following values are returned
|
||||
self.assertEqual(self.form.hourSpinBox.value(), 0)
|
||||
|
Loading…
Reference in New Issue
Block a user