Some of my pages fetch data based on user input. It obviously doesn't make sense to do the actual fetch in test cases, since I should know what is going to be returned and should be checking for what I do with the data.
Is there an easy way to tell if something is running as a test so that I can mock that behavior? I'm thinking of something like def fetch_data_for(input): if TEST: return mock_data(input) else: #do the production stuff Or maybe this isn't the right approach at all and I'm missing something that would make this easier. Thanks, Todd --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---