Changeset 859 in main


Ignore:
Timestamp:
03/07/12 17:44:36 (10 years ago)
Author:
pcosquer
Message:

search: tests++

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/tests/views.py

    r857 r859  
    21272127        self.assertEqual([self.controller.object], results) 
    21282128 
     2129    def test_search_invalid_type(self): 
     2130        results = self.search("NOT nothing", "InvalidType") 
     2131        self.assertEqual([], results) 
     2132 
     2133    def test_search_in_file(self): 
     2134        doc = DocumentController.create("doccc", "Document", "d", 
     2135                self.user, self.DATA) 
     2136        df = doc.add_file(self.get_file(name="pppp.txt", data="monocle monocle")) 
     2137        results = self.search("monocle", "Document") 
     2138        self.assertEqual([df], results) 
     2139        results = self.search("monocl*", "Document") 
     2140        self.assertEqual([df], results) 
     2141        results = self.search("file:monocl*", "Document") 
     2142        self.assertEqual([df], results) 
     2143        results = self.search("dfdf", "Document") 
     2144        self.assertEqual([], results) 
     2145        results = self.search("pppp.txt", "Document") 
     2146        self.assertEqual([df], results) 
     2147 
    21292148 
    21302149class MechantUserViewTest(TestCase): 
Note: See TracChangeset for help on using the changeset viewer.