commenced DRF efforts w. package installation, creation of apps.api, w. UTs & ITs to ensure core efficacy; core.settings & .urls changed to accomodate
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
20
src/apps/api/tests/unit/test_serializers.py
Normal file
20
src/apps/api/tests/unit/test_serializers.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.test import SimpleTestCase
|
||||
from apps.api.serializers import ItemSerializer, ListSerializer
|
||||
|
||||
|
||||
class ItemSerializerTest(SimpleTestCase):
|
||||
def test_fields(self):
|
||||
serializer = ItemSerializer()
|
||||
self.assertEqual(
|
||||
set(serializer.fields.keys()),
|
||||
{"id", "text"},
|
||||
)
|
||||
|
||||
class ListSerializerTest(SimpleTestCase):
|
||||
def test_fields(self):
|
||||
serializer = ListSerializer()
|
||||
self.assertEqual(
|
||||
set(serializer.fields.keys()),
|
||||
{"id", "name", "url", "items"},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user