MocRequest method='POST' is no longer available

18 views
Skip to first unread message

Ozgur Polat

unread,
Jun 15, 2020, 11:17:33 AM6/15/20
to Trac Development
Hi All,

I am trying to write some unittests for my application and I tries to create a moc request with post method. Get method works and returns something but I did not get anything from post method so I went inside the MocReuest method and could not find any 'POST' key word or anything about post method. Seems like this has been removed. Do you know how I can generate a POST request. Here is  the code I tried which did not work:

req = MockRequest(self.gr_api.env, method='POST',
                  args={'create_report': 'create_report',
                        'form_token': 'a token',
                        'get_wiki_link': 'some link'})


RjOllos

unread,
Jun 15, 2020, 3:50:28 PM6/15/20
to Trac Development
MockRequest inherits from trac.web.api.Request and will handle POST methods. 

If you Grep the codebase you'll find many examples like:

- Ryan 
Message has been deleted
Message has been deleted

Ozgur Polat

unread,
Jun 15, 2020, 5:03:45 PM6/15/20
to Trac Development
Thank you.
Reply all
Reply to author
Forward
0 new messages