'Use to assert post was called with JSON.'

def post_called_with(self, *args, **kwargs):

    assert (self.session.post.called is True)
    (call_args, call_kwargs) = self.session.post.call_args
    data = kwargs.pop('data', None)
    (call_args, call_data) = (call_args[:1], call_args[1])
    if ((not isinstance(data, str)) and call_data):
        call_data = json.loads(call_data)
    assert (args == call_args)
    assert (data == call_data)
    assert (kwargs == call_kwargs)
