def test_stats(self, rget): def mocked_get(url, **options): return Response({'documents': 1}, 200, headers={'content-type': 'application/json'}) rget.side_effect = mocked_get result = autocompeter.stats() eq_(result, {'documents': 1})
def test_stats(self, rget): def mocked_get(url, **options): return Response( {'documents': 1}, 200, headers={ 'content-type': 'application/json' } ) rget.side_effect = mocked_get result = autocompeter.stats() eq_(result, {'documents': 1})
def autocompeter_stats(request): return stats()