POST Data + Debugging Django Unittests

Aug 19 at 3:35 PM
Hi,

I have the following unit test:
    def test_post(self):
        response = self.client.post('/', { 'data': 'somedata' })
The view does nothing but raising an exception:
    raise Exception(request.POST)
When calling the unit test via "Run", the POST data is correctly shown in the output.

When debugging the unit test via "Debug", request.POST is empty. How can this be avoided?
Aug 20 at 8:54 AM
Edited Sep 3 at 7:27 AM
When setting a breakpoint, after request.POST is accessed, it works:
    def home(request):
        post = request.POST // When a breakpoint is set here, request.POST is NOT set
        raise Exception(post) // When a breakpoint is only set here, post and request.POST is set
So I will use this as a temporary workaround.

The same does not only apply to unit tests but also to normal debugging. The same goes for other objects like django cursor - added a workitem (https://pytools.codeplex.com/workitem/2655).
Marked as answer by Dresel on 9/3/2014 at 12:27 AM