I need to return a random entry from my database.
I wrote a function, and since I use the random module in Python, it is possible if I hadn't used it stupidly.
Now, how can I write unit test to check if this function works? In the end, if this is a good random value, you will never know.
I am not paranoid, my function is not so complicated, and the standard Python library is 1000 x enough time for my purpose. I do not do cryptography or anything critical. I'm just curious to know if there is a way.
source share