Hi, I am trying pact out for the first time and we...
# pact-python
m
Hi, I am trying pact out for the first time and we are mainly message based. That is where my problem lies. I want to use the matchers in my consumer tests but using them is kinda weird. The way that I would expect them to work according to docs is:
Copy code
event = {
        "event": "delivery:created",
        "delivery_type": matchers.Term("express|standard", "standard"),
    }

    (
        pact_no_publish.given("Delivery has standard shipping")
        .expects_to_receive("delivery:created")
        .with_content(event)
        .with_metadata({"Content-Type": "application/json"})
    )
What this does is to pass the Term object into the message. What I have to do in this case is this:
Copy code
event = {
        "event": "delivery:created",
        "delivery_type": matchers.Term("express|standard", "standard").generate()["data"]["generate"],
    }
Is this the intended way or should it be done im some other way?