reorganized and reclassified old 'unit tests' for ea. app into dirs for UTs & ITs; abandoning effort to refactor any test_views into UTs; all tests passing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
0
src/apps/dashboard/tests/unit/__init__.py
Normal file
0
src/apps/dashboard/tests/unit/__init__.py
Normal file
13
src/apps/dashboard/tests/unit/test_forms.py
Normal file
13
src/apps/dashboard/tests/unit/test_forms.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
from apps.dashboard.forms import (
|
||||
EMPTY_ITEM_ERROR,
|
||||
ItemForm,
|
||||
)
|
||||
|
||||
|
||||
class SimpleItemFormTest(SimpleTestCase):
|
||||
def test_form_validation_for_blank_items(self):
|
||||
form = ItemForm(data={"text": ""})
|
||||
self.assertFalse(form.is_valid())
|
||||
self.assertEqual(form.errors["text"], [EMPTY_ITEM_ERROR])
|
||||
13
src/apps/dashboard/tests/unit/test_models.py
Normal file
13
src/apps/dashboard/tests/unit/test_models.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user