From 24f4b605b23ba4f0bd4ecf2993a3bf2a0f363336 Mon Sep 17 00:00:00 2001 From: dessant Date: Thu, 18 Feb 2016 19:08:33 +0200 Subject: [PATCH] adapt listview selection test to new behavior --- kivy/tests/test_selection.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/kivy/tests/test_selection.py b/kivy/tests/test_selection.py index b78dcc02c..d785e308e 100644 --- a/kivy/tests/test_selection.py +++ b/kivy/tests/test_selection.py @@ -407,18 +407,17 @@ class ListAdapterTestCase(unittest.TestCase): # Now unselect it with handle_selection(). list_adapter.handle_selection(banana) - self.assertFalse(banana.is_selected) - # But, since we have allow_empty_selection=False, Apple will be - # reselected. - self.assertEqual(selection_observer.fruit_name, 'Apple') + # But, since we have allow_empty_selection=False, Banana will stay + # selected, behavior changed in #3672. + self.assertEqual(selection_observer.fruit_name, 'Banana') # Call count: # # Apple got selected initally (0), then unselected when Banana was - # selected (1). Then banana was unselected, causing reselection of - # Apple (3). len should be 1. - self.assertEqual(selection_observer.call_count, 3) + # selected (1). Then banana was unselected (2), and stayed selected. + # len should be 1. + self.assertEqual(selection_observer.call_count, 2) self.assertEqual(len(list_adapter.selection), 1)