def playback(cls, filename):
        """
        .. testcode::

           import io
           import json
           import requests
           import httpretty

           with httpretty.record('/tmp/ip.json'):
               data = requests.get('https://httpbin.org/ip').json()

           with io.open('/tmp/ip.json') as fd:
               assert data == json.load(fd)

        :param filename: a string
        :returns: a `context-manager <https://docs.python.org/3/reference/datamodel.html#context-managers>`_
        """
        cls.enable()

        data = json.loads(open(filename).read())
        for item in data:
            uri = item['request']['uri']
            method = item['request']['method']
            body = item['response']['body']
            headers = item['response']['headers']
            cls.register_uri(method, uri, body=body, forcing_headers=headers)

        yield
        cls.disable()