def test_format_date_no_format_but_configured(self): app = App(config={ 'tipfy.sessions': { 'secret_key': 'secret', }, 'tipfy.i18n': { 'timezone': 'UTC', 'date_formats': { 'time': 'medium', 'date': 'medium', 'datetime': 'medium', 'time.short': None, 'time.medium': None, 'time.full': None, 'time.long': None, 'date.short': None, 'date.medium': 'full', 'date.full': None, 'date.long': None, 'datetime.short': None, 'datetime.medium': None, 'datetime.full': None, 'datetime.long': None, } } }) local.request = request = Request.from_values('/') request.app = app value = datetime.datetime(2009, 11, 10, 16, 36, 05) self.assertEqual(i18n.format_date(value), u'Tuesday, November 10, 2009')
def test_format_date_no_format_but_configured(self): app = App( config={ 'tipfy.sessions': { 'secret_key': 'secret', }, 'tipfy.i18n': { 'timezone': 'UTC', 'date_formats': { 'time': 'medium', 'date': 'medium', 'datetime': 'medium', 'time.short': None, 'time.medium': None, 'time.full': None, 'time.long': None, 'date.short': None, 'date.medium': 'full', 'date.full': None, 'date.long': None, 'datetime.short': None, 'datetime.medium': None, 'datetime.full': None, 'datetime.long': None, } } }) local.request = request = Request.from_values('/') request.app = app value = datetime.datetime(2009, 11, 10, 16, 36, 05) self.assertEqual(i18n.format_date(value), u'Tuesday, November 10, 2009')
def setUp(self): app = App(rules=[Rule('/', name='home', handler=RequestHandler)], config={ 'tipfy.sessions': { 'secret_key': 'secret', }, 'tipfy.i18n': { 'timezone': 'UTC' }, }) local.request = request = Request.from_values('/') request.app = app test_utils.BaseTestCase.setUp(self)
def setUp(self): app = App(rules=[ Rule('/', name='home', handler=RequestHandler) ], config={ 'tipfy.sessions': { 'secret_key': 'secret', }, 'tipfy.i18n': { 'timezone': 'UTC' }, }) local.request = request = Request.from_values('/') request.app = app test_utils.BaseTestCase.setUp(self)