def test_examplejson(self, jq): request = testing.DummyRequest(params={'selection': 'example'}) views = Views(request) jq.defaults.return_value = 'foo' response = views.defaults() jq.defaults.assert_called_with('example') self.assertDictEqual(response, {'success': True, 'data': 'foo'})
def test_defaultsjson(self, jq): request = testing.DummyRequest() views = Views(request) jq.defaults.return_value = 'foo' response = views.defaults() jq.defaults.assert_called_with(None) self.assertDictEqual(response, {'success': True, 'data': 'foo'})