You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classDummyLocks(object):
_locks_module=django.core.files.locksdef__init__(self, fs):
pass@staticmethoddeflock(f, flags):
returnTrue@staticmethoddefunlock(f):
returnTruedef__getattr__(self, name):
"""Forwards any non-faked calls to the standard module."""returngetattr(self._locks_module, name)
classFakeFSTestCase(pyfakefs.fake_filesystem_unittest.TestCase):
def__init__(self, methodName='runTest'):
pyfakefs.fake_filesystem_unittest.TestCase.__init__(
self, methodName, modules_to_patch={'locks': DummyLocks})
yields
Traceback (most recent call last):
File "D:\..\tests\testUploadFilesView.py", line 33, in setUp
self.setUpPyfakefs()
File "D:\..\lib\site-packages\pyfakefs\fake_filesystem_unittest.py", line 187, in setUpPyfakefs
modules_to_patch=modules_to_patch)
File "D:\..\lib\site-packages\pyfakefs\fake_filesystem_unittest.py", line 350, in __init__
for fct_name in fake_module.dir():
AttributeError: type object 'DummyLocks' has no attribute 'dir'
The text was updated successfully, but these errors were encountered:
The following code, taken from the documentation:
yields
The text was updated successfully, but these errors were encountered: