Files
python-tdd/src/apps/dashboard/tests/unit/test_models.py

14 lines
353 B
Python
Raw Normal View History

from django.test import SimpleTestCase
from apps.dashboard.models import Item
class SimpleItemModelTest(SimpleTestCase):
def test_default_text(self):
item = Item()
self.assertEqual(item.text, "")
def test_string_representation(self):
item = Item(text="sample text")
self.assertEqual(str(item), "sample text")