  ...             name = '.'.join([basename, str(number)] + ext)
  ...             number += 1
  ...
  ...         return name
  >>> custom_storage = CustomStorage(tempfile.gettempdir())
  
  >>> first = custom_storage.save('custom_storage', ContentFile('custom contents'))
  >>> first
  u'custom_storage'
  >>> second = custom_storage.save('custom_storage', ContentFile('more contents'))
 
</s> remove >>> temp_storage = FileSystemStorage(location=tempfile.gettempdir())
 </s> add # Set up a unique temporary directory
>>> import os
>>> temp_dir = tempfile.mktemp()
>>> os.makedirs(temp_dir)

>>> temp_storage = FileSystemStorage(location=temp_dir)
>>> custom_storage = CustomStorage(temp_dir)
  ...             name = '.'.join([basename, str(number)] + ext)
  ...             number += 1
  ...
  ...         return name
>>> custom_storage = CustomStorage(temp_dir)
  
  >>> first = custom_storage.save('custom_storage', ContentFile('custom contents'))
  >>> first
  u'custom_storage'
  >>> second = custom_storage.save('custom_storage', ContentFile('more contents'))
keep keep keep keep replace keep keep keep keep keep
 Fixed #8244: Modified the temporary directory used by file storage tests so that mutliple test runs can be performed in parallel without conflict. 

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8376 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
tests/regressiontests/file_storage/tests.py