Ignore:
Timestamp:
23 Jun 2011, 15:41:51 (14 years ago)
Author:
Henrik Bettermann
Message:

Use constants in tests.

File:
1 edited

Legend:

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

    r6470 r6472  
    3232from waeup.sirp.accesscodes.accesscodes import (
    3333    AccessCode, AccessCodeBatch, invalidate_accesscode, disable_accesscode)
     34from waeup.sirp.accesscodes.workflow import INITIALIZED, USED, DISABLED
    3435
    3536
     
    110111        # Now we want to find the disabled access code
    111112        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    112         results1 = cat.searchResults(state=('disabled', 'disabled'))
    113         results2 = cat.searchResults(state=('initialized', 'initialized'))
     113        results1 = cat.searchResults(state=(DISABLED, DISABLED))
     114        results2 = cat.searchResults(state=(INITIALIZED, INITIALIZED))
    114115        results1 = [x for x in results1] # Turn results generator into list
    115116        # We found 1 accescode disabled
     
    125126        # Now we want to find the invalidated access code
    126127        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    127         results1 = cat.searchResults(state=('used', 'used'))
    128         results2 = cat.searchResults(state=('initialized', 'initialized'))
     128        results1 = cat.searchResults(state=(USED, USED))
     129        results2 = cat.searchResults(state=(INITIALIZED, INITIALIZED))
    129130        results1 = [x for x in results1] # Turn results generator into list
    130131        # We found 1 accescode used
     
    145146        # exactly one access code.
    146147        results = cat.searchResults(history='Tester',
    147                                     state=('used', 'used'),
     148                                    state=(USED, USED),
    148149                                    code=('APP-1-11111111', 'APP-1-22222222'))
    149150        assert len(results) == 1
     
    154155        # immediately in catalog
    155156        cat = queryUtility(ICatalog, name='accesscodes_catalog')
    156         result = cat.searchResults(state=('used', 'used'))
     157        result = cat.searchResults(state=(USED, USED))
    157158        assert len(result) == 0
    158159        invalidate_accesscode('APP-1-11111111')
    159         result = cat.searchResults(state=('used', 'used'))
     160        result = cat.searchResults(state=(USED, USED))
    160161        assert len(result) == 1
Note: See TracChangeset for help on using the changeset viewer.