def test_was_published_recently_con_encuestas_viejas( self ): """was_published_recently() deberia devolver falso para preguntas que fechas de publicacion con más de un día de antiguedad.""" time = timezone.now() - datetime.timedelta( days = 30 ) old_question = Question( pub_date = time ) self.assertEqual( old_question.was_published_recently(), False )
def test_was_published_recently_con_encuestas_recientes( self ): """was_published_recently() deberia devolver Verdad para preguntas que pub_date is within the last day.""" time = timezone.now() - datetime.timedelta( hours = 1 ) recent_question = Question( pub_date = time ) self.assertEqual( recent_question.was_published_recently(), True )
def test_was_published_recently_con_encuestas_futuras( self ): """was_published_recently() deberia devolver falso para preguntas que tienen fecha de publicacion en el futuro.""" time = timezone.now() + datetime.timedelta( days = 30 ) future_question = Question( pub_date = time ) self.assertEqual( future_question.was_published_recently(), False )