def test_debug_user(self): """ debug_user passes the expected args to request(), returns the result. """ email = "*****@*****.**" supertoken = "STOKEN" params = {'email': email, 'supertoken': supertoken} with patch('basket.base.request', autospec=True) as request_call: result = debug_user(email, supertoken) request_call.assert_called_with('get', 'debug-user', params=params) self.assertEqual(request_call.return_value, result)
def get_user(email): try: user_data = basket.debug_user(email, SUPERTOKEN) except basket.BasketException: user_data = None return user_data
def get_user(email): try: return basket.debug_user(email, SUPERTOKEN) except basket.BasketException: return None