Permalink
Browse files

Simple hack for making exists work as expected

  • Loading branch information...
1 parent d1d8016 commit e73a09f30530c06b26ee88d802e012e03aafbada @dcramer committed Dec 27, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 mock_django/query.py
View
@@ -76,6 +76,7 @@ def _iterator(*a, **k):
m.__getitem__.side_effect = make_getitem(m)
m.model = model
m.get = make_get(m, actual_model)
+ m.exists.return_value = bool(return_value)
# Note since this is a SharedMock, *all* auto-generated child
# attributes will have the same side_effect ... might not make

0 comments on commit e73a09f

Please sign in to comment.