From 9f044367ea3e96e211b08766a1f0abdb570c0d6f Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Thu, 22 Mar 2007 13:57:26 +0000
Subject: [PATCH] Check default value of getDescription accessor.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13560 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/tests/testERP5Type.py | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/tests/testERP5Type.py b/product/ERP5Type/tests/testERP5Type.py
index 3d12ee28df..29086a0d0e 100644
--- a/product/ERP5Type/tests/testERP5Type.py
+++ b/product/ERP5Type/tests/testERP5Type.py
@@ -804,7 +804,8 @@ class TestPropertySheet:
       self.assertEquals(person.getProperty(property_name, 'foo'), 'foo')
       self.assertEquals(person.getProperty(property_name, d='foo'), 'foo')
 
-    def test_15b_DefaultValueDefinedOnPropertySheet(self,quiet=quiet, run=run_all_test):
+    def test_15b_DefaultValueDefinedOnPropertySheet(self, quiet=quiet, 
+                                                    run=run_all_test):
       """Tests that the default value is returned correctly when a default
       value is defined using the property sheet.
       """
@@ -835,6 +836,20 @@ class TestPropertySheet:
       self.assertEquals(value, person.getProperty('dummy_ps_prop'))
       self.assertEquals(value, person.getProperty('dummy_ps_prop', d='default'))
 
+    def test_15c_getDescriptionDefaultValue(self):
+      """
+      Tests that the default value of getDescription is returned correctly
+      """
+      portal = self.getPortal()
+      module = self.getPersonModule()
+      person = module.newContent(portal_type='Person')
+
+      # test default value of getDescription accessor
+      # as defined in the DublinCore PropertySheet
+      self.assertEquals(None, person.getDescription())
+      self.assertEquals('foo', 
+                        person.getDescription('foo'))
+
     def test_16_SimpleStringAccessor(self,quiet=quiet, run=run_all_test):
       """Tests a simple string accessor.
       This is also a way to test _addProperty method """
-- 
2.30.9