Testing defaultViewable
=======================

  >>> import Products.Five
  >>> from Products.Five import zcml
  >>> zcml.load_config('configure.zcml', package=Products.Five)

PROPFIND without defaultViewable
--------------------------------

  >>> print http(r"""
  ... PROPFIND /test_folder_1_ HTTP/1.1
  ... Authorization: Basic test_user_1_:secret
  ... Content-Length: 250
  ... Content-Type: application/xml
  ... Depth: 1
  ... 
  ... <?xml version="1.0" encoding="utf-8"?>
  ... <propfind xmlns="DAV:"><prop>
  ... <getlastmodified xmlns="DAV:"/>
  ... <creationdate xmlns="DAV:"/>
  ... <resourcetype xmlns="DAV:"/>
  ... <getcontenttype xmlns="DAV:"/>
  ... <getcontentlength xmlns="DAV:"/>
  ... </prop></propfind>
  ... """, handle_errors=False)
  HTTP/1.1 207 Multi-Status
  Connection: close
  Content-Length: ...
  Content-Location: http://localhost/test_folder_1_/
  Content-Type: text/xml; charset="utf-8"
  Date: ...
  <BLANKLINE>
  <?xml version="1.0" encoding="utf-8"?>
  <d:multistatus xmlns:d="DAV:">
  <d:response>
  <d:href>/test_folder_1_/</d:href>
  <d:propstat>
    <d:prop>
  <n:getlastmodified xmlns:n="DAV:">...
  <n:creationdate xmlns:n="DAV:">...
  <n:resourcetype xmlns:n="DAV:"><n:collection/></n:resourcetype>
  <n:getcontenttype xmlns:n="DAV:"></n:getcontenttype>
  <n:getcontentlength xmlns:n="DAV:"></n:getcontentlength>
    </d:prop>
    <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
  </d:response>
  <d:response>
  <d:href>/test_folder_1_/acl_users</d:href>
  <d:propstat>
    <d:prop>
  <n:getlastmodified xmlns:n="DAV:">...
  <n:creationdate xmlns:n="DAV:">...
  <n:resourcetype xmlns:n="DAV:"></n:resourcetype>
  <n:getcontenttype xmlns:n="DAV:"></n:getcontenttype>
  <n:getcontentlength xmlns:n="DAV:"></n:getcontentlength>
    </d:prop>
    <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
  </d:response>
  </d:multistatus>

PROPFIND with defaultViewable
-----------------------------

Now make the class default viewable:

  >>> from Products.Five.fiveconfigure import classDefaultViewable
  >>> from OFS.Folder import Folder
  >>> classDefaultViewable(Folder)

And try it again:

  >>> print http(r"""
  ... PROPFIND /test_folder_1_ HTTP/1.1
  ... Authorization: Basic test_user_1_:secret
  ... Content-Length: 250
  ... Content-Type: application/xml
  ... Depth: 1
  ... 
  ... <?xml version="1.0" encoding="utf-8"?>
  ... <propfind xmlns="DAV:"><prop>
  ... <getlastmodified xmlns="DAV:"/>
  ... <creationdate xmlns="DAV:"/>
  ... <resourcetype xmlns="DAV:"/>
  ... <getcontenttype xmlns="DAV:"/>
  ... <getcontentlength xmlns="DAV:"/>
  ... </prop></propfind>
  ... """, handle_errors=False)
  HTTP/1.1 207 Multi-Status
  Connection: close
  Content-Length: ...
  Content-Location: http://localhost/test_folder_1_/
  Content-Type: text/xml; charset="utf-8"
  Date: ...
  <BLANKLINE>
  <?xml version="1.0" encoding="utf-8"?>
  <d:multistatus xmlns:d="DAV:">
  <d:response>
  <d:href>/test_folder_1_/</d:href>
  <d:propstat>
    <d:prop>
  <n:getlastmodified xmlns:n="DAV:">...
  <n:creationdate xmlns:n="DAV:">...
  <n:resourcetype xmlns:n="DAV:"><n:collection/></n:resourcetype>
  <n:getcontenttype xmlns:n="DAV:"></n:getcontenttype>
  <n:getcontentlength xmlns:n="DAV:"></n:getcontentlength>
    </d:prop>
    <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
  </d:response>
  <d:response>
  <d:href>/test_folder_1_/acl_users</d:href>
  <d:propstat>
    <d:prop>
  <n:getlastmodified xmlns:n="DAV:">...
  <n:creationdate xmlns:n="DAV:">...
  <n:resourcetype xmlns:n="DAV:"></n:resourcetype>
  <n:getcontenttype xmlns:n="DAV:"></n:getcontenttype>
  <n:getcontentlength xmlns:n="DAV:"></n:getcontentlength>
    </d:prop>
    <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
  </d:response>
  </d:multistatus>

Clean up
--------

  >>> from zope.app.tests.placelesssetup import tearDown
  >>> tearDown()
