Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
mock autospeccing harming
>>> 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/", line 631, in __getattr__
raise AttributeError("Mock object has no attribute %r" % name)
AttributeError: Mock object has no attribute 'cleaned_data'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment