Re: mocking out a Model
>> @patch('apps.market.models.House')
>
> Is create house in apps.market.models, or is it somewhere else? If
> it's somewhere else, mock it relative to that file eg:
> @patch('apps.some_file.House')
def create_house can be found in apps/deps/house_factory.py
Inside house_factory I ' from apps.market.models import House '
I tried running the test like you said by patching it like:
@patch('apps.deps.house_factory.House')
But for some reason I'm getting a MemoryError by nose.
I tried patching it with patch.object next,
@patch.object('apps.deps.house_factory', 'House')
Then I'm receiving a:
AttributeError: apps.deps.house_factory does not have the attribute 'House'
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home