Exemplo n.º 1
0
def tab_redirect(request, redirect_type = 'server'):
    app_data_query_string = utils.app_data_query_string_encode(request.GET)
    # Cast into unicode string to avoid `join` treating it as a `__proxy__`
    tab_url = unicode(settings.FACEBOOK_TAB_URL)
    final_url = '?'.join([tab_url, app_data_query_string])

    if redirect_type == 'js':
        return utils.js_redirect(final_url, request)

    return redirect(final_url)
Exemplo n.º 2
0
    def test_app_data_query_string_encode(self):
        app_data_dict = {
            'foo': 'bar!',
            'baz': 'fooz',
            'scene': 'some-scene',
        }

        query_string = utils.app_data_query_string_encode(app_data_dict)
        eq_(urllib.unquote(query_string), 'app_data[foo]=bar!&'
            'app_data[baz]=fooz&app_data[scene]=some-scene')
Exemplo n.º 3
0
    def test_app_data_query_string_encode(self):
        app_data_dict = {
            'foo': 'bar!',
            'baz': 'fooz',
            'scene': 'some-scene',
        }

        query_string = utils.app_data_query_string_encode(app_data_dict)
        eq_(
            urllib.unquote(query_string), 'app_data[foo]=bar!&'
            'app_data[baz]=fooz&app_data[scene]=some-scene')