Ticket #29194: tests.py
File tests.py, 467 bytes (added by , 7 years ago) |
---|
Line | |
---|---|
1 | from django.test import TestCase, TransactionTestCase |
2 | from .models import Question |
3 | import datetime |
4 | |
5 | # Create your tests here. |
6 | class 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() |