Fix tests for Python 2.6.
This commit is contained in:
parent
67f8960655
commit
bc156b46f4
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue