From f9710d033c27c2c75ebb0f77632c1ba9f6075b09 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Fri, 30 May 2014 11:17:12 -0700 Subject: [PATCH] fix integration test for 307 update head_insert for new wombat remove redundant host jinja func, use 'urlsplit' instead --- pywb/ui/head_insert.html | 8 +++++--- pywb/webapp/views.py | 6 ------ tests/test_integration.py | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/pywb/ui/head_insert.html b/pywb/ui/head_insert.html index bd5beed9..72d30142 100644 --- a/pywb/ui/head_insert.html +++ b/pywb/ui/head_insert.html @@ -2,9 +2,11 @@ {% if rule.js_rewrite_location %} {% endif %} diff --git a/pywb/webapp/views.py b/pywb/webapp/views.py index 1582f93d..639bcc52 100644 --- a/pywb/webapp/views.py +++ b/pywb/webapp/views.py @@ -46,12 +46,6 @@ def format_ts(value, format_='%a, %b %d %Y %H:%M:%S'): return value.strftime(format_) -@template_filter('host') -def get_hostname(url): - split = urlparse.urlsplit(url) - return split.netloc - - @template_filter('urlsplit') def get_urlsplit(url): split = urlparse.urlsplit(url) diff --git a/tests/test_integration.py b/tests/test_integration.py index 9d0fad17..a710cfe4 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -188,12 +188,12 @@ class TestWb: # without timestamp resp = self.testapp.get('/_css/2013.1/screen.css', headers = [('Referer', 'http://localhost:8080/pywb/2014/http://iana.org/')]) - assert resp.status_int == 302 + assert resp.status_int == 307 assert resp.headers['Location'] == target, resp.headers['Location'] # with timestamp resp = self.testapp.get('/2014/_css/2013.1/screen.css', headers = [('Referer', 'http://localhost:8080/pywb/2014/http://iana.org/')]) - assert resp.status_int == 302 + assert resp.status_int == 307 assert resp.headers['Location'] == target, resp.headers['Location']