Hello
I am writting my unit tests but i have “internal” functions not accesible via HTTP, how can i test that parts of code?
Best regards.
Hello
I am writting my unit tests but i have “internal” functions not accesible via HTTP, how can i test that parts of code?
Best regards.
Hi kr0m,
You can import those functions into your test file, set up the data required to use the function if any, call the function, then verify the results of that function. The mock functionality might also be useful in cases where only need to verify that something was called (see patch).
Thank you, i will try it
Tim, it worked, thank you for your help
You’re welcome. I’m glad you were able to get it working.