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()
|
view = self.view()
|
||||||
query = Mock()
|
query = Mock()
|
||||||
filtered = view.filter_query(query)
|
filtered = view.filter_query(query)
|
||||||
self.assertIs(filtered, query)
|
self.assertTrue(filtered is query)
|
||||||
|
|
||||||
def test_make_query(self):
|
def test_make_query(self):
|
||||||
view = self.view()
|
view = self.view()
|
||||||
|
@ -33,7 +33,7 @@ class BareAutocompleteViewTests(TestCase):
|
||||||
query = Mock()
|
query = Mock()
|
||||||
view.make_query = Mock(return_value=query)
|
view.make_query = Mock(return_value=query)
|
||||||
filtered = view.query('test')
|
filtered = view.query('test')
|
||||||
self.assertIs(filtered, query)
|
self.assertTrue(filtered is query)
|
||||||
|
|
||||||
def test_display(self):
|
def test_display(self):
|
||||||
view = self.view()
|
view = self.view()
|
||||||
|
@ -78,7 +78,7 @@ class SampleAutocompleteViewTests(TestCase):
|
||||||
def test_make_query(self):
|
def test_make_query(self):
|
||||||
view = self.view()
|
view = self.view()
|
||||||
view.mapped_class.thing.ilike.return_value = 'whatever'
|
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%')
|
view.mapped_class.thing.ilike.assert_called_with('%test%')
|
||||||
self.query.filter.assert_called_with('whatever')
|
self.query.filter.assert_called_with('whatever')
|
||||||
self.query.order_by.assert_called_with(view.mapped_class.thing)
|
self.query.order_by.assert_called_with(view.mapped_class.thing)
|
||||||
|
|
|
@ -71,7 +71,7 @@ class DepartmentCrudTests(TestCase):
|
||||||
fieldset = Mock()
|
fieldset = Mock()
|
||||||
view.make_fieldset = Mock(return_value=fieldset)
|
view.make_fieldset = Mock(return_value=fieldset)
|
||||||
fs = view.fieldset(Mock())
|
fs = view.fieldset(Mock())
|
||||||
self.assertIs(fs, fieldset)
|
self.assertTrue(fs is fieldset)
|
||||||
|
|
||||||
|
|
||||||
class DepartmentsByVendorGridTests(TestCase):
|
class DepartmentsByVendorGridTests(TestCase):
|
||||||
|
@ -84,10 +84,10 @@ class DepartmentsByVendorGridTests(TestCase):
|
||||||
query = mock_query()
|
query = mock_query()
|
||||||
view = self.view(params={'uuid': '1'})
|
view = self.view(params={'uuid': '1'})
|
||||||
view.make_query = Mock(return_value=query)
|
view.make_query = Mock(return_value=query)
|
||||||
self.assertIs(view.query(), query)
|
self.assertTrue(view.query() is query)
|
||||||
|
|
||||||
def test_grid(self):
|
def test_grid(self):
|
||||||
view = self.view()
|
view = self.view()
|
||||||
grid = Mock()
|
grid = Mock()
|
||||||
view.make_grid = Mock(return_value=grid)
|
view.make_grid = Mock(return_value=grid)
|
||||||
self.assertIs(view.grid(), grid)
|
self.assertTrue(view.grid() is grid)
|
||||||
|
|
Loading…
Reference in a new issue