[fake-request] support `http_method()`
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 15 Mar 2012 17:57:40 +0100
changeset 8315 166e6d5d8e17
parent 8314 cfd6ab461849
child 8316 d5b1b75805dd
[fake-request] support `http_method()`
devtools/fake.py
--- a/devtools/fake.py	Thu Mar 15 18:34:59 2012 +0100
+++ b/devtools/fake.py	Thu Mar 15 17:57:40 2012 +0100
@@ -61,6 +61,7 @@
         if not (args or 'vreg' in kwargs):
             kwargs['vreg'] = CWRegistryStore(FakeConfig(), initlog=False)
         kwargs['https'] = False
+        self._http_method = kwargs.pop('method', 'GET')
         self._url = kwargs.pop('url', None) or 'view?rql=Blop&vid=blop'
         super(FakeRequest, self).__init__(*args, **kwargs)
         self._session_data = {}
@@ -75,6 +76,10 @@
         """returns an ordered list of preferred languages"""
         return ('en',)
 
+    def http_method(self):
+        return self._http_method
+
+
     def header_if_modified_since(self):
         return None