[Zope-dev] FS PageTemplates and XML generation issues

Florent Guillaume fg at nuxeo.com
Wed Dec 22 12:05:58 EST 2004


Alan Milligan wrote:
> Florent Guillaume wrote:
> 
> |> | Use:
> |> |
> |> | [default]
> |> | content_type = text/foobar
> |>
> |> No, this doesn't work either :(
> |
> |
> | Well it should, there are unit tests in CMFCore that explicitely test
> | this kind of .metadata file.
> |
> No, I had a look and there's a strange test with a FSPT which explicitly
> sets the REQUEST content-type.  There's no test which checks this from a
> .metadata file.  There is a test which checks the title in a .properties
> file.

Ah sorry, the test is only on CMF 1.5 and HEAD. Not sure whether this 
feature works on 1.4.

Florent

> 
> I extended these tests (test_DirectoryView.py) and indeed setting
> content_type as a property does pass the test.  I also added a .metadata
> test and it actually does pass this test too, although .metadata and
> .properties files do appear mutually exclusive.
> 
> I've attached the patch of these tests if you want to apply it.
> 
> So, now I can't explain why my real-world .metadata content_type is
> being ignored!
> 
> Cheers, Alan
> 
> 

------------------------------------------------------------------------

diff -Naur tests.orig/fake_skins/fake_skin/testPT2.pt 
tests/fake_skins/fake_skin/testPT2.pt
--- tests.orig/fake_skins/fake_skin/testPT2.pt	1970-01-01 
10:00:00.000000000 +1000
+++ tests/fake_skins/fake_skin/testPT2.pt	2004-12-23 03:45:59.000568152 
+1100
@@ -0,0 +1 @@
+<div tal:replace="request/SERVER_NAME" />
\ No newline at end of file
diff -Naur tests.orig/fake_skins/fake_skin/testPT2.pt.metadata 
tests/fake_skins/fake_skin/testPT2.pt.metadata
--- tests.orig/fake_skins/fake_skin/testPT2.pt.metadata	1970-01-01 
10:00:00.000000000 +1000
+++ tests/fake_skins/fake_skin/testPT2.pt.metadata	2004-12-23 
03:40:28.149865104 +1100
@@ -0,0 +1,3 @@
+[default]
+title=Zope Pope
+content_type=text/foobar
diff -Naur tests.orig/test_DirectoryView.py tests/test_DirectoryView.py
--- tests.orig/test_DirectoryView.py	2004-12-23 03:31:18.220467080 +1100
+++ tests/test_DirectoryView.py	2004-12-23 03:47:10.077762776 +1100
@@ -123,6 +123,11 @@
          """Make sure the directory view is reading properties"""
          self.assertEqual(self.ob.fake_skin.testPT.title, 'Zope Pope')

+    def test_metadata(self):
+        """Make sure the directory view is reading properties"""
+	self.assertEqual(self.ob.fake_skin.testPT2.content_type, 'text/foobar')
+        self.assertEqual(self.ob.fake_skin.testPT2.title, 'Zope Pope')
+
      def test_ignored(self):
          """ Test that the .test1.py is ignored """
          assert('#test1' not in self.ob.fake_skin.objectIds())


-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope-Dev mailing list