예제 #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 app_data_query_string else tab_url)

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

    return redirect(final_url)
예제 #2
0
 def setUp(self):
     self.request = Mock(["locale"])
     self.request.locale = "en-US"
     self.url = "https://www.mozilla.org/"
     self.response = utils.js_redirect(self.url, self.request)
예제 #3
0
 def setUp(self):
     self.request = Mock(['locale', 'GET'])
     self.request.locale = 'en-US'
     self.request.GET = {}
     self.url = 'https://www.mozilla.org/'
     self.response = utils.js_redirect(self.url, self.request)
예제 #4
0
파일: test_utils.py 프로젝트: 6a68/bedrock
 def setUp(self):
     self.request = Mock(['locale', 'GET'])
     self.request.locale = 'en-US'
     self.request.GET = {}
     self.url = 'https://www.mozilla.org/'
     self.response = utils.js_redirect(self.url, self.request)