[CMF-checkins] CVS: CMF - test_Document.py:1.8

Jeffrey Shell jeffrey@digicool.com
Thu, 31 May 2001 20:25:07 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault/tests
In directory korak.digicool.com:/home/jeffrey/InstanceHomes/cmf-dev/CMF/CMFDefault/tests

Modified Files:
	test_Document.py 
Log Message:
Added keyword/subject tag check to test_StructuredText() too.



--- Updated File test_Document.py in package CMF --
--- test_Document.py	2001/06/01 00:22:14	1.7
+++ test_Document.py	2001/06/01 00:25:07	1.8
@@ -34,6 +34,8 @@
 Title: My Document
 Description: A document by me
 Contributors: foo@bar.com baz@bam.net no@yes.maybe
+Subject: content management, zope
+Keywords: unit tests; , framework
 
 This is the header
 
@@ -118,6 +120,7 @@
 
     def test_StructuredText(self):
         d = Document('foo')
+        assert hasattr(d, 'cooked_text')
         d.edit(text_format='structured-text', text=BASIC_STRUCTUREDTEXT)
         
         assert d.Format() == 'text/plain'
@@ -129,6 +132,17 @@
         # Make sure extra HTML is NOT found
         assert string.find(d.cooked_text, '<title>') == -1, d.cooked_text
         assert string.find(d.cooked_text, '<body>') == -1, d.cooked_text
+
+        # test subject/keyword headers
+        subj = list(d.Subject())
+        assert len(subj) == 4
+        subj.sort()
+        assert subj == [
+            'content management',
+            'framework',
+            'unit tests',
+            'zope'
+            ]
 
     def test_Init(self):
         d = Document('foo', text=BASIC_STRUCTUREDTEXT)