Created
December 18, 2017 12:22
-
-
Save solidpple/e56f7e3db8a54d61f18826b295ba9e17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from django.utils import timezone | |
from django.test import TestCase | |
from .models import Question | |
class QuestionModelTests(TestCase): | |
def test_was_published_recently_with_future_question(self): | |
""" | |
was_published_recently() returns False for questions whose pub_date | |
is in the future. | |
""" | |
time = timezone.now() + datetime.timedelta(days=30) | |
future_question = Question(pub_date=time) | |
self.assertIs(future_question.was_published_recently(), False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment