Example #1
0
    except:
        response['body']['string'] = gzip_string(decompressed.replace(settings.USERNAME, TESTING_USERNAME))
        return response

    if 'screenname' not in response_dict:
        return response
    if response_dict['screenname'] is not None:
        response_dict['screenname'] = TESTING_USERNAME
    response_dict['userid'] = 1
    response_dict['thumbnail'] = ''
    response['body']['string'] = gzip_string(simplejson.dumps(response_dict))
    return response


before_record = util.compose(scrub_request_body,
                             remove_headers(headers_to_remove=('Set-Cookie',
                                                               'Cookie')))


def match_search_query(left, right):
    left_filter = set([value for param_name, value in left.query
                               if 'filter' in param_name])
    right_filter = set([value for param_name, value in right.query
                                if 'filter' in param_name])
    left_rest = set([(param_name, value) for param_name, value in left.query
                     if 'filter' not in param_name])
    right_rest = set([(param_name, value) for param_name, value in right.query
                      if 'filter' not in param_name])
    return left_filter == right_filter and left_rest == right_rest