diff test/db_test_base.py @ 3601:7b25567f0f54

indexing may be turned off for FileClass "content" now
author Richard Jones <richard@users.sourceforge.net>
date Thu, 27 Apr 2006 01:39:47 +0000
parents f47bddab5a49
children 57c66056ffe4
line wrap: on
line diff
--- a/test/db_test_base.py	Thu Apr 06 06:01:35 2006 +0000
+++ b/test/db_test_base.py	Thu Apr 27 01:39:47 2006 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 #
-# $Id: db_test_base.py,v 1.68 2006-03-03 02:02:50 richard Exp $
+# $Id: db_test_base.py,v 1.69 2006-04-27 01:39:47 richard Exp $
 
 import unittest, os, shutil, errno, imp, sys, time, pprint, sets
 
@@ -73,6 +73,7 @@
     user.setkey("username")
     file = module.FileClass(db, "file", name=String(), type=String(),
         comment=String(indexme="yes"), fooz=Password())
+    file_nidx = module.FileClass(db, "file_nidx", content=String(indexme='no'))
     issue = module.IssueClass(db, "issue", title=String(indexme="yes"),
         status=Link("status"), nosy=Multilink("user"), deadline=Date(),
         foo=Interval(), files=Multilink("file"), assignedto=Link('user'),
@@ -784,6 +785,17 @@
         self.assertEquals(self.db.indexer.search(['hello'], self.db.issue),
             {i1: {'files': [f2]}})
 
+    def testFileClassIndexingNoNoNo(self):
+        f1 = self.db.file.create(content='hello')
+        self.db.commit()
+        self.assertEquals(self.db.indexer.search(['hello'], self.db.file),
+            {'1': {}})
+
+        f1 = self.db.file_nidx.create(content='hello')
+        self.db.commit()
+        self.assertEquals(self.db.indexer.search(['hello'], self.db.file_nidx),
+            {})
+
     def testForcedReindexing(self):
         self.db.issue.create(title="flebble frooz")
         self.db.commit()
@@ -1258,6 +1270,14 @@
         a.setkey("name")
         self.db.post_init()
 
+    def test_fileClassProps(self):
+        self.db = self.module.Database(config, 'admin')
+        a = self.module.FileClass(self.db, 'a')
+        l = a.getprops().keys()
+        l.sort()
+        self.assert_(l, ['activity', 'actor', 'content', 'created',
+            'creation', 'type'])
+
     def init_ab(self):
         self.db = self.module.Database(config, 'admin')
         a = self.module.Class(self.db, "a", name=String())

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