Skip to content

urlencoded matcher does not check empty dict values #533

@codeasashu

Description

@codeasashu

Describe the bug

I am asserting a request having blank value in a dict key but it is failing as it is omitted out by urlencoded matcher.

Additional context

No response

Version of responses

0.20.0

Steps to Reproduce

import responses
from responses import matchers

@responses.activate
def test_it():
    url = "http://httpbin.org/post"
    responses.add(responses.POST, url, match=[
        matchers.urlencoded_params_matcher({"a": "", "b": "abc"})
    ], json={"c": "d"})
    requests.post(url, body={"a": "", "b": "abc"})

Expected Result

The test should pass

Actual Result

The test fails with "Request body does not match" error

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions