Skip to content

Commit

Permalink
Upgrade webob
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 25, 2018
1 parent 6550bda commit 5de4fe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions geoportal/tests/functional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import os
from configparser import ConfigParser
from webob.acceptparse import Accept
import webob.acceptparse

from pyramid import testing

Expand Down Expand Up @@ -168,7 +168,7 @@ def create_dummy_request(additional_settings=None, authentication=True, user=Non
"geometry_validation": True
}
}, *args, **kargs)
request.accept_language = Accept("fr-CH,fr;q=0.8,en;q=0.5,en-US;q=0.3")
request.accept_language = webob.acceptparse.create_accept_language_header("fr-CH,fr;q=0.8,en;q=0.5,en-US;q=0.3")
request.registry.settings.update(additional_settings)
request.referer = "http://example.com/app"
request.path_info_peek = lambda: "main"
Expand Down
7 changes: 3 additions & 4 deletions geoportal/tests/functional/test_fulltextsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from pyramid import testing
from pyramid.response import Response
import webob.acceptparse

from tests.functional import ( # noqa
teardown_common as teardown_module,
Expand Down Expand Up @@ -181,11 +182,10 @@ def _create_dummy_request(username=None, params=None):
def test_no_default_laguage(self):
from pyramid.httpexceptions import HTTPInternalServerError
from c2cgeoportal_geoportal.views.fulltextsearch import FullTextSearchView
from webob.acceptparse import Accept

request = self._create_dummy_request()
del(request.registry.settings["default_locale_name"])
request.accept_language = Accept("es")
request.accept_language = webob.acceptparse.create_accept_language_header("es")

fts = FullTextSearchView(request)
response = fts.fulltextsearch()
Expand All @@ -194,11 +194,10 @@ def test_no_default_laguage(self):
def test_unknown_laguage(self):
from pyramid.httpexceptions import HTTPInternalServerError
from c2cgeoportal_geoportal.views.fulltextsearch import FullTextSearchView
from webob.acceptparse import Accept

request = self._create_dummy_request()
request.registry.settings["default_locale_name"] = "it"
request.accept_language = Accept("es")
request.accept_language = webob.acceptparse.create_accept_language_header("es")
fts = FullTextSearchView(request)
response = fts.fulltextsearch()
self.assertTrue(isinstance(response, HTTPInternalServerError))
Expand Down

0 comments on commit 5de4fe8

Please sign in to comment.