Skip to content

Instantly share code, notes, and snippets.

@mattjmorrison
Created February 20, 2011 05:49
Show Gist options
  • Save mattjmorrison/835749 to your computer and use it in GitHub Desktop.
Save mattjmorrison/835749 to your computer and use it in GitHub Desktop.
Simple django mocking test example 4
@mock.patch('django_testing.models.SampleManager.get_last')
@mock.patch('django_testing.models.SampleManager.get_first')
def test_result_of_one_query_in_args_of_another(self, get_first, get_last):
result = models.Sample.objects.get_first_and_last()
self.assertEqual((get_first.return_value, get_last.return_value), result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment