Ticket #29194: tests.py

File tests.py, 467 bytes (added by Alberto Misail, 7 years ago)

Tests file

Line 
1from django.test import TestCase, TransactionTestCase
2from .models import Question
3import datetime
4
5# Create your tests here.
6class Tests(TransactionTestCase):
7 def test_text_field_fail(self):
8 a = 'a'*8000
9 q = Question(question_text=a, pub_date=datetime.datetime.now())
10 q.save()
11
12 def test_text_field_pass(self):
13 a = 'a' * 100
14 q = Question(question_text=a, pub_date=datetime.datetime.now())
15 q.save()
Back to Top