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
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
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