Created
May 11, 2012 14:51
-
-
Save k-bx/2660237 to your computer and use it in GitHub Desktop.
mock autospeccing harming
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
>>> 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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment