def test_mode(self):
        """Replace the HTTP adapters with a fauxquests.FauxAdapter, which
        will make the client into a faux client.
        """
        # Import this here, because we don't want to require fauxquests
        # in order for the app to work.
        from fauxquests.adapter import FauxAdapter
        with settings.runtime_values(host='20.12.4.21', username='meagan',
                                     password='This is the best wine.',
                                     verbose=False, format='json'):
            adapters = copy.copy(self.adapters)
            faux_adapter = FauxAdapter(
                url_pattern=self.get_prefix().rstrip('/') + '%s',
            )

            try:
                self.adapters.clear()
                self.mount('https://', faux_adapter)
                self.mount('http://', faux_adapter)
                yield faux_adapter
            finally:
                self.adapters = adapters
def test_mode ( self ) : from fauxquests . adapter import FauxAdapter with settings . runtime_values ( host = '20.12.4.21' , username = 'meagan' , password = 'This is the best wine.' , verbose = False , format = 'json' ) : adapters = copy . copy ( self . adapters ) faux_adapter = FauxAdapter ( url_pattern = self . get_prefix ( ) . rstrip ( '/' ) + '%s' , ) try : self . adapters . clear ( ) self . mount ( 'https://' , faux_adapter ) self . mount ( 'http://' , faux_adapter ) yield faux_adapter finally : self . adapters = adapters
Replace the HTTP adapters with a fauxquests.FauxAdapter, which
        will make the client into a faux client.