fix tests

This commit is contained in:
Maxim Kurnikov
2020-01-05 08:18:43 +03:00
parent 0a92c89d41
commit e5b61dc499
3 changed files with 33 additions and 35 deletions

View File

@@ -60,15 +60,11 @@ def resolve_passed_queryset_info_or_exception(ctx: DynamicClassDefContext) -> Ty
def resolve_django_manager_info_or_exception(ctx: DynamicClassDefContext) -> TypeInfo:
api = sem_helpers.get_semanal_api(ctx)
sym = api.lookup_fully_qualified_or_none(fullnames.MANAGER_CLASS_FULLNAME)
if (sym is None
or sym.node is None
or isinstance(sym.node, PlaceholderNode)):
info = helpers.lookup_fully_qualified_typeinfo(api, fullnames.MANAGER_CLASS_FULLNAME)
if info is None:
raise sem_helpers.BoundNameNotFound(fullnames.MANAGER_CLASS_FULLNAME)
assert isinstance(sym.node, TypeInfo)
return sym.node
return info
def new_manager_typeinfo(ctx: DynamicClassDefContext, callee_manager_info: TypeInfo) -> TypeInfo: