Lets say you have a website, that uses a function to retrieve data from the database and returns the result to be displayed/parsed/etc...
Since the data that is retrieve
You can't, really. You'll need a guaranteed static set of data to create reliable unit tests. Perhaps a database snapshot will work for you.
Dynamic data can be useful in other ways, such as to perform regression testing...