Display validity date

This commit is contained in:
Florent 2013-02-01 10:49:17 +01:00
commit 124e72aeb8

View file

@ -36,14 +36,15 @@ class HomePage(BasePage):
credit = divabo.xpath('dl/dd')[1].text
expiredate = divabo.xpath('dl/dd')[2].text
phoneplan = divabo.xpath('dl/dd')[3].text
self.browser.logger.debug('Found ' + owner + ' has subscriber')
self.browser.logger.debug('Found ' + phone + ' has phone number')
self.browser.logger.debug('Found ' + credit + ' has available credit')
self.browser.logger.debug('Found ' + expiredate + 'has expire date ')
self.browser.logger.debug('Found ' + phoneplan + ' has subscription type')
self.browser.logger.debug('Found ' + owner + ' as subscriber')
self.browser.logger.debug('Found ' + phone + ' as phone number')
self.browser.logger.debug('Found ' + credit + ' as available credit')
self.browser.logger.debug('Found ' + expiredate + ' as expire date ')
self.browser.logger.debug('Found %s as subscription type', phoneplan)
subscription = Subscription(phone)
subscription.label = unicode(phone + u' - ' + credit + u' - ' + phoneplan)
subscription.label = unicode(u'%s - %s - %s - %s' %
(phone, credit, phoneplan, expiredate))
subscription.subscriber = unicode(owner)
expiredate = date(*reversed([int(x) for x in expiredate.split(".")]))
subscription.validity = expiredate