Commit 10c9f862 authored by Jérome Perrin's avatar Jérome Perrin

erp5_credential: fix wrongly configured properties

parent 4320819e
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
<item> <item>
<key> <string>acquisition_base_category</string> </key> <key> <string>acquisition_base_category</string> </key>
<value> <value>
<tuple> <tuple/>
<string>region</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -71,7 +69,9 @@ ...@@ -71,7 +69,9 @@
</item> </item>
<item> <item>
<key> <string>acquisition_portal_type</string> </key> <key> <string>acquisition_portal_type</string> </key>
<value> <string>python: (\'Category\',)</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>acquisition_sync_value</string> </key> <key> <string>acquisition_sync_value</string> </key>
......
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
<item> <item>
<key> <string>acquisition_base_category</string> </key> <key> <string>acquisition_base_category</string> </key>
<value> <value>
<tuple> <tuple/>
<string>region</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -71,7 +69,9 @@ ...@@ -71,7 +69,9 @@
</item> </item>
<item> <item>
<key> <string>acquisition_portal_type</string> </key> <key> <string>acquisition_portal_type</string> </key>
<value> <string>python: (\'Category\',)</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>acquisition_sync_value</string> </key> <key> <string>acquisition_sync_value</string> </key>
......
420 421
\ No newline at end of file \ No newline at end of file
...@@ -136,6 +136,7 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -136,6 +136,7 @@ class TestERP5Credential(ERP5TypeTestCase):
'site/dakar', 'site/dakar',
'site/paris', 'site/paris',
'site/tokyo', 'site/tokyo',
'region/europe/fr',
) )
def beforeTearDown(self): def beforeTearDown(self):
...@@ -1359,6 +1360,34 @@ class TestERP5Credential(ERP5TypeTestCase): ...@@ -1359,6 +1360,34 @@ class TestERP5Credential(ERP5TypeTestCase):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_credential_request_properties(self):
# test to prevent regression with a bug in property sheet definition
cr = self.portal.credential_request_module.newContent(
portal_type='Credential Request')
self.assertEquals(cr.getDefaultAddressCity(), None)
self.assertEquals(cr.getDefaultAddressRegion(), None)
self.assertEquals(cr.getOrganisationDefaultAddressCity(), None)
self.assertEquals(cr.getOrganisationDefaultAddressRegion(), None)
cr.setDefaultAddressRegion('europe/fr')
self.assertEquals(cr.getDefaultAddressCity(), None)
self.assertEquals(cr.getDefaultAddressRegion(), 'europe/fr')
self.assertEquals(cr.getOrganisationDefaultAddressCity(), None)
self.assertEquals(cr.getOrganisationDefaultTelephoneText(), None)
self.assertEquals(cr.getOrganisationDefaultAddressRegion(), None)
cr.deleteContent('default_address')
cr.setOrganisationDefaultAddressCity('Lille')
cr.setOrganisationDefaultAddressRegion('europe/fr')
self.assertEquals(cr.getOrganisationDefaultAddressCity(), 'Lille')
self.assertEquals(cr.getOrganisationDefaultAddressRegion(), 'europe/fr')
self.assertEquals(cr.getDefaultAddressCity(), None)
self.assertEquals(cr.getDefaultAddressRegion(), None)
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment