public
Created

mock autospeccing harming

  • Download Gist
gistfile1.pytb
Python traceback
1 2 3 4 5 6 7 8 9 10 11 12 13
>>> from mock import create_autospec
>>> class A(object):
... def __init__(self, data):
... self.cleaned_data = data
...
>>> m_A = create_autospec(A)
>>> m_A({'a': 'b'}).cleaned_data
Traceback (most recent call last):
File "<ipython-input-5-66064b709d22>", line 1, in <module>
m_A({'a': 'b'}).cleaned_data
File "/home/kost/.virtualenvs/shwp/local/lib/python2.7/site-packages/mock-1.0a2-py2.7.egg/mock.py", line 631, in __getattr__
raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute 'cleaned_data'

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.