Files
files_mephi/Работы/web/python/sem2/web/polls/tests.py
T
2026-03-29 20:19:34 +03:00

14 lines
358 B
Python

from django.test import TestCase
from .models import Question
from django.utils import timezone
class QuestionTest(TestCase):
def test_create_object(self):
obj = Question.objects.create(
question_text="What's new?",
pub_date=timezone.now()
)
self.assertTrue(Question.objects.filter(id=obj.id).exists())