add webpanel/test_models.py as example

This commit is contained in:
calm-steam 2025-02-16 15:26:29 +05:30
parent 98b9574c67
commit 9cec170f62
Signed by: calm-steam
SSH Key Fingerprint: SHA256:VrjxFRfRdJ0oc+FjTdi2wneFAslmWVg6/r6Z773npjE

11
webpanel/test_models.py Normal file
View File

@ -0,0 +1,11 @@
from django.test import TestCase
from webpanel.models import Game
class GameTestCase(TestCase):
def setUp(self):
Game.objects.create(name="Assassin's Creed")
def test_game_creation(self):
assassins = Game.objects.get(name="Assassin's Creed")
assert str(assassins) == "Assassin's Creed"