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)
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)
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)