parent
5bbfa35af9
commit
1820dca352
2 changed files with 17 additions and 0 deletions
@ -1,3 +1,13 @@ |
|||||||
from django.test import TestCase |
from django.test import TestCase |
||||||
|
import datetime |
||||||
|
from django.utils import timezone |
||||||
|
from .models import Question |
||||||
|
|
||||||
|
|
||||||
# Create your tests here. |
# 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) |
||||||
|
Loading…
Reference in new issue