You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from django.test import TestCase
|
|
|
|
import datetime
|
|
|
|
from django.utils import timezone
|
|
|
|
from .models import Question
|
|
|
|
|
|
|
|
|
|
|
|
# Create your tests here.
|
|
|
|
|
|
|
|
class QuestionModelTests(TestCase):
|
|
|
|
def test_was_published_recently_with_future_question(self):
|
|
|
|
time = timezone.now() + datetime.timedelta(days=30)
|
|
|
|
future_question = Question(pub_date=time)
|
|
|
|
self.assertIs(future_question.was_published_recently(), False)
|