Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Naive copy and paste test for request_param tuples for #465

  • Loading branch information...
commit 4d372477ccf0e2b8c88d7f3cf05d8666f87d4980 1 parent 8cfb7d2
@rpatterson authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 pyramid/tests/test_config/test_views.py
View
20 pyramid/tests/test_config/test_views.py
@@ -1173,6 +1173,26 @@ def test_add_view_with_request_param_val_false(self):
request.params = {'abc':''}
self._assertNotFound(wrapper, None, request)
+ def test_add_view_with_request_param_multi_true(self):
+ from pyramid.renderers import null_renderer
+ view = lambda *arg: 'OK'
+ config = self._makeOne(autocommit=True)
+ config.add_view(view=view, request_param=('abc=123', 'foo'),
+ renderer=null_renderer)
+ wrapper = self._getViewCallable(config)
+ request = self._makeRequest(config)
+ request.params = {'abc':'123', 'foo':''}
+ self.assertEqual(wrapper(None, request), 'OK')
+
+ def test_add_view_with_request_param_multi_false(self):
+ view = lambda *arg: 'OK'
+ config = self._makeOne(autocommit=True)
+ config.add_view(view=view, request_param=('abc=123', 'foo'))
+ wrapper = self._getViewCallable(config)
+ request = self._makeRequest(config)
+ request.params = {'abc':''}
+ self._assertNotFound(wrapper, None, request)
+
def test_add_view_with_xhr_true(self):
from pyramid.renderers import null_renderer
view = lambda *arg: 'OK'
Please sign in to comment.
Something went wrong with that request. Please try again.