[CMF-checkins] CVS: Products/CMFDefault/tests - test_Document.py:1.34 test_Link.py:1.12

Stefan H. Holek stefan at epy.co.at
Sat Jul 31 10:06:38 EDT 2004


Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv23861/CMFDefault/tests

Modified Files:
	test_Document.py test_Link.py 
Log Message:
WebDAV PUT() caused improper splitting of 'Contributors' metadata header.


=== Products/CMFDefault/tests/test_Document.py 1.33 => 1.34 ===
--- Products/CMFDefault/tests/test_Document.py:1.33	Mon Apr 26 08:14:18 2004
+++ Products/CMFDefault/tests/test_Document.py	Sat Jul 31 10:06:33 2004
@@ -469,6 +469,22 @@
         self.assertEqual( d.Description(), 'Describe me' )
         self.assertEqual( r.status, 204 )
 
+    def test_PutHtmlWithoutMetadata(self):
+        html = HTML_TEMPLATE % {'title': 'Foo', 'body': 'Bar'}
+        self.REQUEST['BODY'] = html
+        d = self._makeOne('foo')
+        r = d.PUT(self.REQUEST, self.RESPONSE)
+        self.assertEqual( d.Title(), 'Foo' )
+        self.assertEqual( d.Format(), 'text/html' )
+        self.assertEqual( d.Description(), '' )
+        self.assertEqual( d.Subject(), () )
+        self.assertEqual( d.Contributors(), () )
+        self.assertEqual( d.EffectiveDate(), 'None' )
+        self.assertEqual( d.ExpirationDate(), 'None' )
+        self.assertEqual( d.Language(), '' )
+        self.assertEqual( d.Rights(), '' )
+        self.assertEqual( r.status, 204 )
+
 
 def test_suite():
     return TestSuite((


=== Products/CMFDefault/tests/test_Link.py 1.11 => 1.12 ===
--- Products/CMFDefault/tests/test_Link.py:1.11	Mon Apr 26 08:14:18 2004
+++ Products/CMFDefault/tests/test_Link.py	Sat Jul 31 10:06:33 2004
@@ -73,6 +73,19 @@
         self.assertEqual( len(d.Subject()), 3 )
         self.assertEqual( d.getRemoteUrl(), 'http://www.zope.org' )
 
+    def test_PutWithoutMetadata(self):
+        d = self._makeOne('foo')
+        d._writeFromPUT( body='' )
+        self.assertEqual( d.Title(), '' )
+        self.assertEqual( d.Format(), 'text/url' )
+        self.assertEqual( d.Description(), '' )
+        self.assertEqual( d.Subject(), () )
+        self.assertEqual( d.Contributors(), () )
+        self.assertEqual( d.EffectiveDate(), 'None' )
+        self.assertEqual( d.ExpirationDate(), 'None' )
+        self.assertEqual( d.Language(), '' )
+        self.assertEqual( d.Rights(), '' )
+
     def test_fixupMissingScheme(self):
         table = {
             'http://foo.com':      'http://foo.com',



More information about the CMF-checkins mailing list