Changeset 6437


Ignore:
Timestamp:
20 Jun 2011, 20:08:24 (14 years ago)
Author:
uli
Message:

Add test for mixed search.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_catalog.py

    r6436 r6437  
    134134        assert len(results2) == 2
    135135        assert [x for x in results2] == [self.ac2, self.ac3]
     136
     137    def test_search_mixed(self):
     138        # We can ask for several attributes at the same time
     139        invalidate_accesscode('APP-1-11111111', comment='Used by Tester')
     140        disable_accesscode('APP-1-33333333', comment='Disabled by Tester')
     141        cat = queryUtility(ICatalog, name='accesscodes_catalog')
     142        # Now we search for an applicants code that has 'Tester'
     143        # mentioned in history, is used, and has a code between
     144        # 'APP-1-11111111' and 'APP-2-11111111'. This should find
     145        # exactly one access code.
     146        results = cat.searchResults(history='Tester',
     147                                    used=(True, True),
     148                                    code=('APP-1-11111111', 'APP-1-22222222'))
     149        assert len(results) == 1
     150        assert self.ac1 in results
Note: See TracChangeset for help on using the changeset viewer.