14 lines
358 B
Python
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())
|