Changeset 6374 for main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests
- Timestamp:
- 15 Jun 2011, 23:45:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/tests/test_accesscodes.py
r6359 r6374 29 29 from waeup.sirp.accesscodes.accesscodes import ( 30 30 AccessCodeBatch, get_access_code, invalidate_accesscode, 31 disable_accesscode )31 disable_accesscode, reenable_accesscode) 32 32 33 33 class AccessCodeHelpersTests(FunctionalTestCase): … … 89 89 def test_invalidate_accesscode(self): 90 90 assert self.ac1._invalidation_date is None 91 result = invalidate_accesscode('APP-1-11111111') 92 assert self.ac1._invalidation_date is not None 93 assert result is True 94 95 def test_invalidate_used_accesscode(self): 91 96 invalidate_accesscode('APP-1-11111111') 92 assert self.ac1._invalidation_date is not None 97 inv_date = self.ac1._invalidation_date 98 result = invalidate_accesscode('APP-1-11111111') 99 assert result is False 100 assert self.ac1._invalidation_date == inv_date 101 102 def test_invalidate_disabled_accesscode(self): 103 # disabled acs cannot be invalidated. 104 disable_accesscode('APP-1-11111111') 105 result = invalidate_accesscode('APP-1-11111111') 106 assert result is False 107 assert self.ac1._disabled is True 93 108 94 109 def test_disable_accesscode_unused(self): … … 102 117 disable_accesscode('APP-1-11111111') 103 118 assert self.ac1._disabled is True 119 120 def test_reenable_accesscode(self): 121 disable_accesscode('APP-1-11111111') 122 result = reenable_accesscode('APP-1-11111111') 123 assert result is True 124 assert self.ac1._disabled is False 125 126 def test_reenable_accesscode_enabled(self): 127 result = reenable_accesscode('APP-1-11111111') 128 assert result is False 129 assert self.ac1._disabled is False
Note: See TracChangeset for help on using the changeset viewer.