2019-06-29 15:40:47 +00:00
|
|
|
from django.test import TestCase
|
2019-08-10 17:58:49 +00:00
|
|
|
from unittest import skip
|
2019-06-29 15:40:47 +00:00
|
|
|
from django_kepi.create import create
|
|
|
|
from django_kepi.models import *
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger(name='tests')
|
|
|
|
|
|
|
|
class TestPolymorph(TestCase):
|
|
|
|
|
|
|
|
def test_invalid_type(self):
|
|
|
|
t = create(
|
|
|
|
f_type = 'Wombat',
|
|
|
|
)
|
|
|
|
self.assertIsNone(t)
|
|
|
|
|
|
|
|
def test_note(self):
|
|
|
|
t = create(
|
|
|
|
f_type = 'Note',
|
|
|
|
)
|
|
|
|
self.assertIsInstance(t, Item)
|
|
|
|
|
|
|
|
def test_person(self):
|
|
|
|
t = create(
|
|
|
|
f_type = 'Person',
|
|
|
|
)
|
|
|
|
self.assertIsInstance(t, Actor)
|
|
|
|
|
2019-08-10 17:58:49 +00:00
|
|
|
@skip('Are Object etc really abstract?')
|
2019-06-29 15:40:47 +00:00
|
|
|
def test_abstract(self):
|
|
|
|
t = create(
|
|
|
|
f_type = 'Object',
|
|
|
|
)
|
|
|
|
self.assertIsNone(t)
|
|
|
|
|