Changeset 6434


Ignore:
Timestamp:
20 Jun 2011, 17:21:35 (13 years ago)
Author:
uli
Message:

Add tests for finding history entries.

File:
1 edited

Legend:

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

    r6433 r6434  
    3030from waeup.sirp.app import University
    3131from waeup.sirp.testing import FunctionalLayer
    32 from waeup.sirp.accesscodes.accesscodes import AccessCode, AccessCodeBatch
     32from waeup.sirp.accesscodes.accesscodes import (
     33    AccessCode, AccessCodeBatch, invalidate_accesscode,)
    3334
    3435
     
    9091        results = [x for x in results] # Turn results generator into list
    9192        assert len(results) == 0
     93
     94    def test_search_history(self):
     95        # We can search for certain history entries
     96        # To update history we use `invalidate_accesscode`
     97        invalidate_accesscode(
     98            'APP-1-11111111', comment='used by Tester')
     99
     100        # Now we want to find the term ``Tester`` in histories of all acs
     101        cat = queryUtility(ICatalog, name='accesscodes_catalog')
     102        results = cat.searchResults(history='Tester')
     103        results = [x for x in results] # Turn results generator into list
     104        assert len(results) == 1
     105        assert results[0] is self.ac1
Note: See TracChangeset for help on using the changeset viewer.