Created
February 20, 2011 05:24
-
-
Save mattjmorrison/835733 to your computer and use it in GitHub Desktop.
Simple django mocking test example 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mock.patch('django_testing.models.SampleManager.filter', mock.Mock()) | |
def test_filters_by_user_with_patch(self): | |
user = mock.Mock() | |
models.Sample.objects.get_by_user(user) | |
models.Sample.objects.filter.assert_called_with(user=user) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment