diff test/test_postgresql.py @ 4878:f6e76a03b502

HTML* classes for cgi are now all new-style Add regression test for old behaviour: Lookup of a value of a HTMLProperty was possibly via getitem -- for old-style classes this worked because __getattr__ returned the __getitem__ of a newly created HTMLItem object, this does no longer work for new-style classes as these look up special method only on the class not the instance.
author Ralf Schlatterbeck <rsc@runtux.com>
date Sat, 29 Mar 2014 10:52:20 +0100
parents 6e3e4f24c753
children 05c857e5dbed
line wrap: on
line diff
--- a/test/test_postgresql.py	Fri Mar 28 16:47:36 2014 +0100
+++ b/test/test_postgresql.py	Sat Mar 29 10:52:20 2014 +0100
@@ -20,7 +20,7 @@
 from roundup.hyperdb import DatabaseError
 
 from db_test_base import DBTest, ROTest, config, SchemaTest, ClassicInitTest
-from db_test_base import ConcurrentDBTest, FilterCacheTest
+from db_test_base import ConcurrentDBTest, HTMLItemTest, FilterCacheTest
 
 from roundup.backends import get_backend, have_backend
 
@@ -66,6 +66,16 @@
         ConcurrentDBTest.tearDown(self)
         postgresqlOpener.tearDown(self)
 
+class postgresqlHTMLItemTest(postgresqlOpener, HTMLItemTest):
+    backend = 'postgresql'
+    def setUp(self):
+        postgresqlOpener.setUp(self)
+        HTMLItemTest.setUp(self)
+
+    def tearDown(self):
+        HTMLItemTest.tearDown(self)
+        postgresqlOpener.tearDown(self)
+
 class postgresqlFilterCacheTest(postgresqlOpener, FilterCacheTest):
     backend = 'postgresql'
     def setUp(self):
@@ -122,6 +132,7 @@
     suite.addTest(unittest.makeSuite(postgresqlClassicInitTest))
     suite.addTest(unittest.makeSuite(postgresqlSessionTest))
     suite.addTest(unittest.makeSuite(postgresqlConcurrencyTest))
+    suite.addTest(unittest.makeSuite(postgresqlHTMLItemTest))
     suite.addTest(unittest.makeSuite(postgresqlFilterCacheTest))
     return suite
 

Roundup Issue Tracker: http://roundup-tracker.org/