[CMF-checkins] CVS: Products/CMFCore/tests - test_CatalogTool.py:1.3.14.2

Florent Guillaume fg at nuxeo.com
Thu Nov 18 10:55:33 EST 2004


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv23989/tests

Modified Files:
      Tag: CMF-1_4-branch
	test_CatalogTool.py 
Log Message:
Better compatibility with existing range syntax implementation.


=== Products/CMFCore/tests/test_CatalogTool.py 1.3.14.1 => 1.3.14.2 ===
--- Products/CMFCore/tests/test_CatalogTool.py:1.3.14.1	Tue Nov 16 16:52:07 2004
+++ Products/CMFCore/tests/test_CatalogTool.py	Thu Nov 18 10:55:32 2004
@@ -118,6 +118,12 @@
             expires={'query': now-1, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': (now-3, now-1), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': (now-3, now-1), 'range': 'minmax'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
     def test_search_restrict_inactive(self):
         catalog = CatalogTool()
@@ -144,6 +150,10 @@
             expires={'query': now+3, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             expires={'query': (now-3, now-1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': (now-3, now-1), 'range': 'minmax'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
     def test_search_restrict_visible(self):
         catalog = CatalogTool()
@@ -170,6 +180,10 @@
             effective={'query': now+1, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             effective={'query': (now-1, now+1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            effective={'query': (now-1, now+1), 'range': 'minmax'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': now-2, 'range': None})))
 
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': now-3, 'range': 'min'})))
@@ -181,6 +195,8 @@
             effective={'query': now+3, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': (now-3, now+3), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            effective={'query': (now-3, now+3), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': now-1, 'range': 'min'})))
@@ -192,6 +208,8 @@
             expires={'query': now+1, 'range': 'max'})))
         self.assertEqual(0, len(catalog.searchResults(
             expires={'query': (now-1, now+1), 'range': 'min:max'})))
+        self.assertEqual(0, len(catalog.searchResults(
+            expires={'query': (now-1, now+1), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': now-3, 'range': 'min'})))
@@ -203,6 +221,8 @@
             expires={'query': now+3, 'range': 'max'})))
         self.assertEqual(1, len(catalog.searchResults(
             expires={'query': (now-3, now+3), 'range': 'min:max'})))
+        self.assertEqual(1, len(catalog.searchResults(
+            expires={'query': (now-3, now+3), 'range': 'minmax'})))
 
         self.assertEqual(1, len(catalog.searchResults(
             effective={'query': now-1, 'range': 'max'},



More information about the CMF-checkins mailing list