Changeset 8200 for main/waeup.kofa/trunk/src
- Timestamp:
- 17 Apr 2012, 23:35:24 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8194 r8200 19 19 """ 20 20 import os 21 import pytz 21 22 import sys 22 23 import grok … … 877 878 def update(self): 878 879 # Check if application has started ... 879 if not self.context.startdate or self.context.startdate > date.today(): 880 if not self.context.startdate or ( 881 self.context.startdate > datetime.now(pytz.utc)): 880 882 self.flash(_('Application has not yet started.')) 881 883 self.redirect(self.url(self.context)) 882 884 return 883 885 # ... or ended 884 if not self.context.enddate or self.context.enddate < date.today(): 886 if not self.context.enddate or ( 887 self.context.enddate < datetime.now(pytz.utc)): 885 888 self.flash(_('Application has ended.')) 886 889 self.redirect(self.url(self.context)) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r8176 r8200 221 221 """Content as language dictionary with values in HTML format.""") 222 222 223 startdate = FormattedDate(223 startdate = schema.Datetime( 224 224 title = _(u'Application Start Date'), 225 225 required = False, 226 show_year = False,227 ) 228 229 enddate = FormattedDate(226 #show_year = False, 227 ) 228 229 enddate = schema.Datetime( 230 230 title = _(u'Application Closing Date'), 231 231 required = False, 232 show_year = False,232 #show_year = False, 233 233 ) 234 234 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r8008 r8200 20 20 import datetime 21 21 import os 22 import pytz 22 23 import shutil 23 24 import tempfile … … 157 158 u'>>de<<\nDieser Text kann von anonymen Benutzern ' 158 159 u'gelesen werden.') 159 self.assertEqual(container.startdate, datetime.date(2012, 3, 1)) 160 self.assertEqual(container.enddate, datetime.date(2012, 4, 25)) 160 self.assertEqual(container.startdate, 161 datetime.datetime(2012, 3, 1, 0, 0, tzinfo=pytz.utc)) 162 self.assertEqual(container.enddate, 163 datetime.datetime(2012, 4, 25, 0, 0, tzinfo=pytz.utc)) 161 164 shutil.rmtree(os.path.dirname(fin_file)) 162 165 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r8069 r8200 19 19 Test the applicant-related UI components. 20 20 """ 21 import pytz 21 22 import shutil 22 23 import tempfile … … 89 90 applicantscontainer.mode = 'create' 90 91 delta = timedelta(days=10) 91 applicantscontainer.startdate = date .today() - delta92 applicantscontainer.enddate = date .today() + delta92 applicantscontainer.startdate = datetime.now(pytz.utc) - delta 93 applicantscontainer.enddate = datetime.now(pytz.utc) + delta 93 94 self.app['applicants']['app2009'] = applicantscontainer 94 95 self.applicantscontainer = self.app['applicants']['app2009'] -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
r8069 r8200 1 1 import datetime 2 2 import os 3 import pytz 3 4 import shutil 4 5 import tempfile … … 56 57 container.description = u'Some Description\nwith linebreak\n' 57 58 container.description += u'<<de>>man spriht deutsh' 58 container.startdate = datetime.date(2012, 1, 1) 59 container.enddate = datetime.date(2012, 1, 31) 59 container.startdate = datetime.datetime( 60 2012, 1, 1, 12, 0, 0, tzinfo=pytz.utc) 61 container.enddate = datetime.datetime( 62 2012, 1, 31, 23, 0, 0, tzinfo=pytz.utc) 60 63 return container 61 64 … … 74 77 'dp2012,General Studies 2012/13,app,100,2012,basic,' 75 78 '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",' 76 '2012-01-01 ,2012-01-31,1\r\n'79 '2012-01-01 12:00:00+00:00,2012-01-31 23:00:00+00:00,1\r\n' 77 80 ) 78 81 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r8167 r8200 639 639 self.assertEqual(payment.p_id, 'p1290797973744') 640 640 cdate = payment.creation_date.strftime("%Y-%m-%d %H:%M:%S") 641 self.assertEqual(cdate, "2010-11-26 1 9:59:33")642 self.assertEqual(str(payment.creation_date.tzinfo),' tzinfo(60)')641 self.assertEqual(cdate, "2010-11-26 18:59:33") 642 self.assertEqual(str(payment.creation_date.tzinfo),'UTC') 643 643 shutil.rmtree(os.path.dirname(fin_file)) 644 644 -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/overrides.zcml
r8171 r8200 34 34 /> 35 35 36 <!-- Register pytz-aware edit widget for datetimes --> 37 <adapter 38 for="zope.schema.interfaces.IDatetime 39 zope.publisher.interfaces.browser.IBrowserRequest" 40 provides="zope.formlib.interfaces.ISimpleInputWidget" 41 factory="waeup.kofa.widgets.datetimewidget.PytzDatetimeWidget" 42 permission="zope.Public" 43 /> 44 36 45 </configure>
Note: See TracChangeset for help on using the changeset viewer.