django-typed-models icon indicating copy to clipboard operation
django-typed-models copied to clipboard

recast doesn't work when passing a class and not a string

Open souliane opened this issue 2 years ago • 0 comments

Python 3.10.7 Django==4.1.5 django-typed-models 0.12.0

recast() does not work when passing a class and not a string.

Here, base will be self.__class__ because typed model subclasses also have the _typedmodels_registry attribute.

Later, this will evaluates to False if the target typ is not the same as self.__class__.

PS: the test here works because BigCat is a Feline. It should be change so that the target model is not a subclass of self.__class__.

souliane avatar Jan 18 '23 13:01 souliane