Changeset 9267 for main/waeup.kofa/trunk
- Timestamp:
- 2 Oct 2012, 07:34:48 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/accesscodes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/batching.py
r9266 r9267 187 187 items_changed = '' 188 188 # Update state 189 # Attention: When importing states the counters remain unchanged. 189 190 if row.has_key('state'): 190 191 state = row.get('state', IGNORE_MARKER) … … 196 197 IObjectHistory(obj).addMessage(msg) 197 198 row.pop('state') 198 # Fire transition199 # Trigger transition. Counters are properly changed. 199 200 if row.has_key('transition'): 200 201 transition = row.get('transition', IGNORE_MARKER) -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.txt
r9260 r9267 114 114 ... 115 115 ...5 116 ... /116 ... 117 117 ...0 118 118 ... -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser_templates/batchcontainer.pt
r9245 r9267 8 8 <th> </th> 9 9 <th i18n:translate="">Prefix</th> 10 <th i18n:translate="">Entries/(invalidated)</th> 10 <th i18n:translate="">Entries</th> 11 <th i18n:translate="">Used</th> 12 <th i18n:translate="">Disabled</th> 11 13 <th i18n:translate="">Cost</th> 12 14 <th i18n:translate="">Date of Creation</th> … … 28 30 <td> 29 31 <span tal:replace="batch/entry_num">1012</span> 30 / 32 </td> 33 <td> 31 34 <span tal:replace="batch/used_num">512</span> 35 </td> 36 <td> 37 <span tal:replace="batch/disabled_num">112</span> 32 38 </td> 33 39 <td tal:content="batch/cost">12.12</td> -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_batching.py
r9266 r9267 180 180 self.csv_file, AC_HEADER_FIELDS) 181 181 182 self.assertEqual(self.app['accesscodes']['HOS-1'].used_num, 1) 183 self.assertEqual(self.app['accesscodes']['HOS-1'].disabled_num, 0) 184 self.assertEqual(self.app['accesscodes']['CLR-1'].used_num, 1) 185 self.assertEqual(self.app['accesscodes']['CLR-1'].disabled_num, 0) 186 182 187 self.csv_file = os.path.join(self.workdir, 'sample_ac_data_update.csv') 183 188 open(self.csv_file, 'wb').write(AC_SAMPLE_DATA_UPDATE) … … 200 205 "|<YYYY-MM-DD hh:mm:ss> UTC - used by system|" 201 206 "|<YYYY-MM-DD hh:mm:ss> UTC - disabled by system") 207 # When importing transitions the counters are properly set. 208 self.assertEqual(self.app['accesscodes']['HOS-1'].used_num, 0) 209 self.assertEqual(self.app['accesscodes']['HOS-1'].disabled_num, 1) 210 # When importing states the counters remain unchanged. 211 self.assertEqual(self.app['accesscodes']['CLR-1'].used_num, 1) 212 self.assertEqual(self.app['accesscodes']['CLR-1'].disabled_num, 0) 202 213 return
Note: See TracChangeset for help on using the changeset viewer.