From bc156b46f4582ea224e104e9031522ec4d101b7c Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 15 Feb 2014 22:39:27 -0800 Subject: [PATCH] Fix tests for Python 2.6. --- tests/views/test_autocomplete.py | 6 +++--- tests/views/test_departments.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/views/test_autocomplete.py b/tests/views/test_autocomplete.py index bfb7ad22..dc630af4 100644 --- a/tests/views/test_autocomplete.py +++ b/tests/views/test_autocomplete.py @@ -21,7 +21,7 @@ class BareAutocompleteViewTests(TestCase): view = self.view() query = Mock() filtered = view.filter_query(query) - self.assertIs(filtered, query) + self.assertTrue(filtered is query) def test_make_query(self): view = self.view() @@ -33,7 +33,7 @@ class BareAutocompleteViewTests(TestCase): query = Mock() view.make_query = Mock(return_value=query) filtered = view.query('test') - self.assertIs(filtered, query) + self.assertTrue(filtered is query) def test_display(self): view = self.view() @@ -78,7 +78,7 @@ class SampleAutocompleteViewTests(TestCase): def test_make_query(self): view = self.view() view.mapped_class.thing.ilike.return_value = 'whatever' - self.assertIs(view.make_query('test'), self.query) + self.assertTrue(view.make_query('test') is self.query) view.mapped_class.thing.ilike.assert_called_with('%test%') self.query.filter.assert_called_with('whatever') self.query.order_by.assert_called_with(view.mapped_class.thing) diff --git a/tests/views/test_departments.py b/tests/views/test_departments.py index 877fecf0..3041359d 100644 --- a/tests/views/test_departments.py +++ b/tests/views/test_departments.py @@ -71,7 +71,7 @@ class DepartmentCrudTests(TestCase): fieldset = Mock() view.make_fieldset = Mock(return_value=fieldset) fs = view.fieldset(Mock()) - self.assertIs(fs, fieldset) + self.assertTrue(fs is fieldset) class DepartmentsByVendorGridTests(TestCase): @@ -84,10 +84,10 @@ class DepartmentsByVendorGridTests(TestCase): query = mock_query() view = self.view(params={'uuid': '1'}) view.make_query = Mock(return_value=query) - self.assertIs(view.query(), query) + self.assertTrue(view.query() is query) def test_grid(self): view = self.view() grid = Mock() view.make_grid = Mock(return_value=grid) - self.assertIs(view.grid(), grid) + self.assertTrue(view.grid() is grid)