Ejemplo n.º 1
0
def create_soon_expiring():
    advert = Advert()
    advert.set_owner('*****@*****.**')
    advert.set_title('Glug')
    advert.set_authors('Mug')
    advert.set_price(50)
    advert.set_expires((datetime.now() + timedelta(hours=36)).strftime(DATE_FORMAT))
    advert.save()
    print advert.owner
    return advert
Ejemplo n.º 2
0
def create_still_okay():
    advert = Advert()
    advert.set_owner('*****@*****.**')
    advert.set_title('Foot')
    advert.set_authors('Feet')
    advert.set_price(50)
    advert.set_expires((datetime.now() + timedelta(days=365)).strftime(DATE_FORMAT))
    advert.save()
    print advert.owner
    return advert
Ejemplo n.º 3
0
def create_expired():
    advert = Advert()
    advert.set_owner('*****@*****.**')
    advert.set_title('Hippy')
    advert.set_authors('Pony')
    advert.set_price(50)
    advert.set_expires((datetime.now() - timedelta(days=365)).strftime(DATE_FORMAT))
    advert.save()
    print advert.owner
    return advert