summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2007-01-31 06:28:49 +0000
committerbbangert <devnull@localhost>2007-01-31 06:28:49 +0000
commita99e6a3198e2e772216a8eb82cac04a3a8740f77 (patch)
tree4ca7d52b4a0d1304230ad7558e3f7d2da0f8230c /tests
parentc3b37a8b6754323365e9a1ff1a24f6fb8392cfc5 (diff)
downloadpaste-a99e6a3198e2e772216a8eb82cac04a3a8740f77.tar.gz
Added WSGIRequest.languages parameter which handles parsing of Accept-Languages header and a unit test to verify the defaults.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_request.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test_request.py b/tests/test_request.py
index 6f29625..4c1802e 100644
--- a/tests/test_request.py
+++ b/tests/test_request.py
@@ -12,7 +12,8 @@ def simpleapp(environ, start_response):
start_response(status, response_headers)
request = WSGIRequest(environ)
return ['Hello world!\n', 'The get is %s' % str(request.GET),
- ' and Val is %s' % request.GET.get('name')]
+ ' and Val is %s' % request.GET.get('name'),
+ 'The languages are: %s' % request.languages]
def test_gets():
app = TestApp(simpleapp)
@@ -23,3 +24,9 @@ def test_gets():
res = app.get('/?name=george')
res.mustcontain("get is MultiDict([('name', 'george')])")
res.mustcontain("Val is george")
+
+def test_language_parsing():
+ app = TestApp(simpleapp)
+ res = app.get('/')
+ assert "The languages are: ['en-us']" in res
+ \ No newline at end of file