def test_project_settings(self): window = Gtk.Window() dialog = ProjectSettingsDialog(parent_window=window, project=self.project, app=self.app) def assert_meta(author, year): self.assertEqual(self.project.author, author) self.assertEqual(self.project.year, year) dialog.author_entry.set_text("a1") dialog.year_spinbutton.set_value(2001) dialog.update_project() assert_meta("a1", "2001") dialog.author_entry.set_text("a2") dialog.year_spinbutton.set_value(2002) dialog.update_project() assert_meta("a2", "2002") self.action_log.undo() assert_meta("a1", "2001") self.action_log.redo() assert_meta("a2", "2002")