Files
kontor/flask/tests/test_tysc_model.py
T
2025-01-14 15:35:53 +01:00

54 lines
1.5 KiB
Python

"""
This module cantains tests for the TYSC data model
"""
import unittest
from . import TestBase
from kontor.tysc import initialize_model
from kontor.tysc.models import Sport, Position, Team, Player
from kontor.tysc.models import Manufacturer, CardSet, ParallelSet, InsertSet, Card
class TestTYSCModel(TestBase):
"""
This TestCase contains tests for TYSC data model.
"""
_initialize_db_ = True
def setUp(self):
if self._initialize_db_:
initialize_model()
self._initialize_db_ = False
def tearDown(self):
pass
def test_sport_model(self):
self.assertEqual(Sport.objects.all().count(), 4)
def test_position_model(self):
self.assertEqual(Position.objects.all().count(), 25)
def test_team_model(self):
self.assertEqual(Team.objects.all().count(), 122)
def test_manufacturer_model(self):
self.assertEqual(Manufacturer.objects.all().count(), 8)
def test_cardset_model(self):
self.assertEqual(CardSet.objects.all().count(), 11)
def test_parallelset_model(self):
self.assertEqual(ParallelSet.objects.all().count(), 3)
def test_insertset_model(self):
self.assertEqual(InsertSet.objects.all().count(), 1)
def test_playerset_model(self):
self.assertEqual(Player.objects.all().count(), 36)
def test_card_model(self):
self.assertEqual(Card.objects.all().count(), 36)
if __name__ == '__main__':
unittest.main()