def test_single_hit(self):
        mocked_qs = MagicMock()
        mocked_qs.count.return_value = 42
        paginator = Paginator(mocked_qs, 5)
        # With the base paginator, requesting any page forces a count.
        paginator.page(1)
        assert paginator.count == 42
        assert mocked_qs.count.call_count == 1

        mocked_qs = MagicMock()
        mocked_qs.__getitem__().execute().hits.total = 666
        paginator = ESPaginator(mocked_qs, 5)
        # With the ES paginator, the count is fetched from the 'total' key
        # in the results.
        paginator.page(1)
        assert paginator.count == 666
        assert mocked_qs.count.call_count == 0
Fetch details of a transaction from PayPal using the token as
dataset/ETHPy150Open mozilla/addons-server/src/olympia/api/tests/test_paginator.py/TestSearchPaginator.test_single_hit--crossover with--dataset/ETHPy150Open django-oscar/django-oscar-paypal/paypal/express/gateway.py/get_txn