[Zope-CVS] CVS: Products/AdaptableStorage/tests - Zope2TestBase.py:1.4.2.3 testASStorage.py:1.4.2.3

Christian Zagrodnick cz@gocept.com
Thu, 23 Jan 2003 12:10:57 -0500


Update of /cvs-repository/Products/AdaptableStorage/tests
In directory cvs.zope.org:/tmp/cvs-serv14215/tests

Modified Files:
      Tag: zagy-patches
	Zope2TestBase.py testASStorage.py 
Log Message:
merging HEAD into zagy-patches branch

=== Products/AdaptableStorage/tests/Zope2TestBase.py 1.4.2.2 => 1.4.2.3 ===
--- Products/AdaptableStorage/tests/Zope2TestBase.py:1.4.2.2	Tue Jan 21 03:11:22 2003
+++ Products/AdaptableStorage/tests/Zope2TestBase.py	Thu Jan 23 12:10:24 2003
@@ -219,6 +219,48 @@
             conn.close()
 
 
+    def testStoreSelectionProperties(self):
+        conn = self.db.open()
+        try:
+            app = conn.root()['Application']
+            f = Folder()
+            f.id = 'Holidays'
+            f.title = 'Holiday Calendar'
+            app._setObject(f.id, f, set_owner=0)
+            get_transaction().commit()
+
+            f._setProperty('choices', ['alpha', 'omega', 'delta'], 'lines')
+            f._setProperty('greek', 'choices', 'multiple selection')
+            f._setProperty('hebrew', 'choices', 'selection')
+            f.greek = ['alpha', 'omega']
+            f.hebrew = 'alpha'
+            get_transaction().commit()
+
+            conn2 = self.db.open()
+            try:
+                app = conn2.root()['Application']
+                self.assert_(hasattr(app, 'Holidays'))
+                got = 0
+                for k, v in app.Holidays.propertyItems():
+                    if k == 'greek':
+                        got += 1
+                        self.assertEqual(v, ['alpha', 'omega'])
+                    if k == 'hebrew':
+                        got += 1
+                        self.assertEqual(v, 'alpha')
+                self.assertEqual(got, 2)
+                # Be sure the select_variable got restored.
+                dict = app.Holidays.propdict()
+                self.assertEqual(dict['greek']['select_variable'], 'choices')
+                self.assertEqual(dict['hebrew']['select_variable'], 'choices')
+            finally:
+                conn2.close()
+
+        finally:
+            conn.close()
+
+
+
     def testStoreUserFolder(self):
         conn = self.db.open()
         try:


=== Products/AdaptableStorage/tests/testASStorage.py 1.4.2.2 => 1.4.2.3 ===