Ignore:
Timestamp:
16 Apr 2012, 16:03:10 (13 years ago)
Author:
Henrik Bettermann
Message:

Set tzinfo of booking_date.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py

    r7811 r8181  
    1818"""Tests for students and related.
    1919"""
     20from datetime import tzinfo
    2021from zope.component.interfaces import IFactory
    2122from zope.interface import verify
     
    7778            TypeError, studylevel.addCourseTicket, department)
    7879
     80    def test_booking_date(self):
     81        isinstance(self.bedticket.booking_date.tzinfo, tzinfo)
     82        self.assertEqual(str(self.bedticket.booking_date.tzinfo), 'UTC')
     83        return
     84
    7985class StudentFactoryTest(FunctionalTestCase):
    8086
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r8084 r8181  
    2121import grok
    2222import string
     23import pytz
     24from random import SystemRandom as r
    2325from zope.i18n import translate
    2426from zope.interface import implements
    25 from random import SystemRandom as r
    2627from waeup.kofa.interfaces import IKofaUtils
    2728from waeup.kofa.interfaces import MessageFactory as _
     
    166167        return send_mail(
    167168            from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config)
     169
     170    @property
     171    def tzinfo(self):
     172        # For Nigeria: pytz.timezone('Africa/Lagos')
     173        return pytz.utc
    168174
    169175    def fullname(self,firstname,lastname,middlename=None):
Note: See TracChangeset for help on using the changeset viewer.