59 |
59 |
60 def __init__(self, *args, **kwargs): |
60 def __init__(self, *args, **kwargs): |
61 if not (args or 'vreg' in kwargs): |
61 if not (args or 'vreg' in kwargs): |
62 kwargs['vreg'] = CWRegistryStore(FakeConfig(), initlog=False) |
62 kwargs['vreg'] = CWRegistryStore(FakeConfig(), initlog=False) |
63 kwargs['https'] = False |
63 kwargs['https'] = False |
|
64 self._http_method = kwargs.pop('method', 'GET') |
64 self._url = kwargs.pop('url', None) or 'view?rql=Blop&vid=blop' |
65 self._url = kwargs.pop('url', None) or 'view?rql=Blop&vid=blop' |
65 super(FakeRequest, self).__init__(*args, **kwargs) |
66 super(FakeRequest, self).__init__(*args, **kwargs) |
66 self._session_data = {} |
67 self._session_data = {} |
67 |
68 |
68 def set_cookie(self, name, value, maxage=300, expires=None, secure=False): |
69 def set_cookie(self, name, value, maxage=300, expires=None, secure=False): |
72 |
73 |
73 ## Implement request abstract API |
74 ## Implement request abstract API |
74 def header_accept_language(self): |
75 def header_accept_language(self): |
75 """returns an ordered list of preferred languages""" |
76 """returns an ordered list of preferred languages""" |
76 return ('en',) |
77 return ('en',) |
|
78 |
|
79 def http_method(self): |
|
80 return self._http_method |
|
81 |
77 |
82 |
78 def header_if_modified_since(self): |
83 def header_if_modified_since(self): |
79 return None |
84 return None |
80 |
85 |
81 def relative_path(self, includeparams=True): |
86 def relative_path(self, includeparams=True): |