On Monday, June 15, 2020 at 8:17:33 AM UTC-7, Ozgur Polat wrote:
>
> 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'})
>
MockRequest inherits from trac.web.api.Request and will handle POST
methods.
If you Grep the codebase you'll find many examples like:
https://trac.edgewall.org/browser/tags/trac-1.4.1/trac/ticket/tests/report.py?marks=70,86,99#L69
- Ryan
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/trac-dev/c6f61a8d-0683-47c3-b400-3ee7752377d4o%40googlegroups.com.