[Zope3-checkins]
SVN: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_proppatch.py
Functional tests for the PROPPATCH functionality
Martijn Pieters
mj at zopatista.com
Thu Oct 14 10:22:57 EDT 2004
Log message for revision 28187:
Functional tests for the PROPPATCH functionality
Changed:
U Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_proppatch.py
-=-
Modified: Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_proppatch.py
===================================================================
--- Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_proppatch.py 2004-10-14 14:22:29 UTC (rev 28186)
+++ Zope3/branches/isarsprint-dav-work/src/zope/app/dav/ftests/test_proppatch.py 2004-10-14 14:22:55 UTC (rev 28187)
@@ -65,6 +65,31 @@
self._assertOPropsEqual(pt,
{u'uri://foo': {u'bar': '<bar>spam</bar>'}})
+ def test_remove_dctitle(self):
+ self.addPage('/pt', u'<span />')
+ pt = traverse(self.getRootFolder(), '/pt')
+ adapted = IZopeDublinCore(pt)
+ adapted.title = u'Test'
+ transaction.commit()
+ # DC Title is a required field with no default, so a 409 is expected
+ expect = self._makePropstat(('http://purl.org/dc/1.1',),
+ '<title xmlns="a0"/>', 409)
+ self.verifyPropOK(path='/pt',
+ namespaces=(('DC', 'http://purl.org/dc/1.1'),),
+ rm=('<DC:title/>',), expect=expect)
+
+ def test_set_dctitle(self):
+ self.addPage('/pt', u'<span />')
+ pt = traverse(self.getRootFolder(), '/pt')
+ adapted = IZopeDublinCore(pt)
+ transaction.commit()
+ expect = self._makePropstat(('http://purl.org/dc/1.1',),
+ '<title xmlns="a0"/>')
+ self.verifyPropOK(path='/pt',
+ namespaces=(('DC', 'http://purl.org/dc/1.1'),),
+ set=('<DC:title>Test Title</DC:title>',), expect=expect)
+ self.assertEqual(IZopeDublinCore(pt).title, u'Test Title')
+
def _assertOPropsEqual(self, obj, expect):
oprops = IDAVOpaqueNamespaces(obj)
namespacesA = list(oprops.keys())
More information about the Zope3-Checkins
mailing list