I am testing an API request. Making sure that the result I get is what is expected.
I have this test for my request:
pm.test("Body matches string SAISONALISÉE", function () {
pm.expect(pm.response.text()).to.include("SAISONALISÉE");
});
The key word “SAISONALISÉE” is indeed in the response and is displayed properly (no encoding issue when I look it in the “Body” tab).
However, the “Test Results” tab is saying that my test failed. Because the key word “SAISONALISÉE” wasn’t find in the response. Though, the response do contain the key word “SAISONALIS\u00c9E”
I tried to add Accept-Charset: UTF-8
to the header of my request, but it didn’t change anything.
I also update postman so that I would have the newest version.
I tried looking through the settings to see if there was anything about character encoding but I came out empty handed.
I do realize I could just change my test to look for the key word “SAISONALIS\u00c9E” but I would much rather understand what is going on and fix it.
So, any idea why the “Body” tab don’t have any issue with the encoding but tests asserting have one ?